Clean-up: sessiond: use empty() instead of comparing size to 0
[lttng-tools.git] / src / bin / lttng-sessiond / ctf2-trace-class-visitor.cpp
index 24fe15792545f43c38120d803e56d81f51fa46ce..71a2e48d2190c29e0401c4876dda9322e815a456 100644 (file)
@@ -165,7 +165,7 @@ private:
                _fragment["alignment"] = type.alignment;
                _fragment["preferred-display-base"] = (unsigned int) type.base_;
 
-               if (type.roles_.size() > 0) {
+               if (!type.roles_.empty()) {
                        json::json role_array = json::json::array();
 
                        for (const auto role : type.roles_) {
@@ -201,12 +201,12 @@ private:
                _fragment["alignment"] = type.alignment;
                _fragment["preferred-display-base"] = (unsigned int) type.base_;
 
-               if (type.roles_.size() > 0) {
+               if (!type.roles_.empty()) {
                        if (std::is_signed<typename EnumerationType::mapping::range_t::
                                                   range_integer_t>::value) {
                                LTTNG_THROW_ERROR(
-                                       fmt::format("Failed to serialize {}: unexpected role",
-                                                   _fragment["type"]));
+                                       lttng::format("Failed to serialize {}: unexpected role",
+                                                     _fragment["type"]));
                        }
 
                        auto role_array = json::json::array();
@@ -219,7 +219,7 @@ private:
                }
 
                if (type.mappings_->size() < 1) {
-                       LTTNG_THROW_ERROR(fmt::format(
+                       LTTNG_THROW_ERROR(lttng::format(
                                "Failed to serialize {}: enumeration must have at least one mapping",
                                _fragment["type"]));
                }
@@ -278,7 +278,7 @@ private:
                _fragment["type"] = "static-length-blob";
                _fragment["length"] = type.length_bytes;
 
-               if (type.roles_.size() > 0) {
+               if (!type.roles_.empty()) {
                        auto role_array = json::json::array();
 
                        for (const auto role : type.roles_) {
This page took 0.026335 seconds and 4 git commands to generate.