cpp-common/bt2: remove useless `avail` variable where applicable
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 26 Nov 2023 01:05:58 +0000 (20:05 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 14 Dec 2023 15:57:04 +0000 (10:57 -0500)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ia7be2c466f4d73f5d5ab1271f918f3f89d3498ec
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11440
Tested-by: jenkins <jenkins@lttng.org>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/cpp-common/bt2/message.hpp
src/cpp-common/bt2/trace-ir.hpp

index 30cf5b31174c3ff9a7cf2f6afd04a91726826166..4acbf6bf08912db52ade1a0404b900cfaf0b0340 100644 (file)
@@ -847,9 +847,8 @@ public:
     bt2s::optional<std::uint64_t> count() const noexcept
     {
         std::uint64_t count;
-        const auto avail = bt_message_discarded_events_get_count(this->libObjPtr(), &count);
 
-        if (avail) {
+        if (bt_message_discarded_events_get_count(this->libObjPtr(), &count)) {
             return count;
         }
 
@@ -978,9 +977,8 @@ public:
     bt2s::optional<std::uint64_t> count() const noexcept
     {
         std::uint64_t count;
-        const auto avail = bt_message_discarded_packets_get_count(this->libObjPtr(), &count);
 
-        if (avail) {
+        if (bt_message_discarded_packets_get_count(this->libObjPtr(), &count)) {
             return count;
         }
 
index 06d4ca53478bdaeca2b204e31ac21693d7e163aa..a043f3cc5c38523feefcb456ed2cf2537a9ec21c 100644 (file)
@@ -973,9 +973,8 @@ public:
     bt2s::optional<LogLevel> logLevel() const noexcept
     {
         bt_event_class_log_level libLogLevel;
-        const auto avail = bt_event_class_get_log_level(this->libObjPtr(), &libLogLevel);
 
-        if (avail == BT_PROPERTY_AVAILABILITY_AVAILABLE) {
+        if (bt_event_class_get_log_level(this->libObjPtr(), &libLogLevel)) {
             return static_cast<LogLevel>(libLogLevel);
         }
 
This page took 0.027104 seconds and 4 git commands to generate.