goto error;
}
- index = ctf_fs_ds_index_create();
- if (!index) {
- goto error;
- }
+ index = bt2s::make_unique<ctf_fs_ds_index>();
for (i = 0; i < file_entry_count; i++) {
struct ctf_packet_index *file_index = (struct ctf_packet_index *) file_pos;
struct ctf_msg_iter *msg_iter)
{
int ret;
- ctf_fs_ds_index::UP index;
enum ctf_msg_iter_status iter_status = CTF_MSG_ITER_STATUS_OK;
auto currentPacketOffset = bt2c::DataLen::fromBytes(0);
BT_CPPLOGI_SPEC(ds_file->logger, "Indexing stream file {}", ds_file->file->path);
- index = ctf_fs_ds_index_create();
- if (!index) {
- goto error;
- }
+ ctf_fs_ds_index::UP index = bt2s::make_unique<ctf_fs_ds_index>();
while (true) {
struct ctf_msg_iter_packet_properties props;
return index;
}
-ctf_fs_ds_index::UP ctf_fs_ds_index_create()
-{
- return bt2s::make_unique<ctf_fs_ds_index>();
-}
-
ctf_fs_ds_file::~ctf_fs_ds_file()
{
(void) ds_file_munmap(this);
struct ctf_fs_ds_file_info *ds_file_info,
struct ctf_msg_iter *msg_iter);
-ctf_fs_ds_index::UP ctf_fs_ds_index_create();
-
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,
src_group->sc->id);
BT_ASSERT(sc);
- auto index = ctf_fs_ds_index_create();
- if (!index) {
- ret = -1;
- goto end;
- }
-
- auto new_dest_group =
- ctf_fs_ds_file_group_create(dest_trace, sc, src_group->stream_id, std::move(index));
+ auto new_dest_group = ctf_fs_ds_file_group_create(dest_trace, sc, src_group->stream_id,
+ bt2s::make_unique<ctf_fs_ds_index>());
if (!new_dest_group) {
ret = -1;