X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fctf2-trace-class-visitor.cpp;h=71a2e48d2190c29e0401c4876dda9322e815a456;hb=20c4b46aee1a984bc558b483826c1078f24d35e9;hp=24fe15792545f43c38120d803e56d81f51fa46ce;hpb=5c7248cd5bce45bf64d563fb4e130a63bf345f11;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp b/src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp index 24fe15792..71a2e48d2 100644 --- a/src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp +++ b/src/bin/lttng-sessiond/ctf2-trace-class-visitor.cpp @@ -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::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_) {