From: Simon Marchi Date: Tue, 27 Jun 2023 16:39:42 +0000 (-0400) Subject: lttng: make session_storage::_array a unique_ptr to array X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a1949b5a1a8efafc3231bb559e3dd42da7c81495;p=lttng-tools.git lttng: make session_storage::_array a unique_ptr to array 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 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/utils.hpp b/src/bin/lttng/utils.hpp index 000509da5..75b91df19 100644 --- a/src/bin/lttng/utils.hpp +++ b/src/bin/lttng/utils.hpp @@ -66,7 +66,7 @@ public: { } - std::unique_ptr::deleter> _array = nullptr; std::size_t _count = 0; @@ -77,7 +77,7 @@ public: 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)