From a1949b5a1a8efafc3231bb559e3dd42da7c81495 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 27 Jun 2023 12:39:42 -0400 Subject: [PATCH] lttng: make session_storage::_array a unique_ptr to array MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng/utils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.34.1