By making this field a unique_ptr of lttng_session[] instead of
lttng_session, we can use the subscript operator on it, making the code
in session_list_operations a bit simpler.
Change-Id: Ic4e441a23be834e68c5af3f4cca2794f86f2f57e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
{
}
- std::unique_ptr<lttng_session,
+ std::unique_ptr<lttng_session[],
lttng::memory::create_deleter_class<lttng_session, lttng::free>::deleter>
_array = nullptr;
std::size_t _count = 0;
static lttng_session& get(const lttng::cli::details::session_storage& storage,
std::size_t index) noexcept
{
- return storage._array.get()[index];
+ return storage._array[index];
}
static std::size_t size(const lttng::cli::details::session_storage& storage)