From bfd852f00e698abc7708b8d2d3b41e3be538a859 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 9 Jun 2022 09:24:46 -0400 Subject: [PATCH] src.ctf.fs: remove ctf_fs_ds_index_destroy Remove ctf_fs_ds_index_destroy and ctf_fs_ds_index_deleter, since ctf_fs_ds_index objects can simply be deleted now. Signed-off-by: Simon Marchi Change-Id: I64eb93eb3f06174523e7f9ceaf94cf103a9e69eb Reviewed-on: https://review.lttng.org/c/babeltrace/+/8255 Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/12293 --- src/plugins/ctf/fs-src/data-stream-file.cpp | 16 +--------------- src/plugins/ctf/fs-src/data-stream-file.hpp | 9 +-------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/plugins/ctf/fs-src/data-stream-file.cpp b/src/plugins/ctf/fs-src/data-stream-file.cpp index f62bbd29..ade19487 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.cpp +++ b/src/plugins/ctf/fs-src/data-stream-file.cpp @@ -868,7 +868,7 @@ end: ctf_fs_ds_index::UP ctf_fs_ds_index_create() { - return ctf_fs_ds_index::UP {new ctf_fs_ds_index}; + return bt2s::make_unique(); } void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *ds_file) @@ -887,20 +887,6 @@ void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *ds_file) delete ds_file; } -void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index) -{ - if (!index) { - return; - } - - delete index; -} - -void ctf_fs_ds_index_deleter::operator()(ctf_fs_ds_index * const index) noexcept -{ - ctf_fs_ds_index_destroy(index); -} - ctf_fs_ds_file_info::UP ctf_fs_ds_file_info_create(const char *path, int64_t begin_ns) { ctf_fs_ds_file_info::UP ds_file_info = bt2s::make_unique(); diff --git a/src/plugins/ctf/fs-src/data-stream-file.hpp b/src/plugins/ctf/fs-src/data-stream-file.hpp index 3059933c..8eadd236 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.hpp +++ b/src/plugins/ctf/fs-src/data-stream-file.hpp @@ -108,14 +108,9 @@ struct ctf_fs_ds_index_entry uint64_t packet_seq_num = 0; }; -struct ctf_fs_ds_index_deleter -{ - void operator()(struct ctf_fs_ds_index *index) noexcept; -}; - struct ctf_fs_ds_index { - using UP = std::unique_ptr; + using UP = std::unique_ptr; std::vector entries; }; @@ -164,8 +159,6 @@ ctf_fs_ds_index::UP ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file, ctf_fs_ds_index::UP ctf_fs_ds_index_create(); -void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index); - ctf_fs_ds_file_info::UP ctf_fs_ds_file_info_create(const char *path, int64_t begin_ns); ctf_fs_ds_file_group::UP ctf_fs_ds_file_group_create(struct ctf_fs_trace *ctf_fs_trace, -- 2.34.1