_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_) {
_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(
_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_) {
void visit(const lst::static_length_array_type& type) final
{
if (type.alignment != 0) {
- LTTNG_ASSERT(_current_field_name.size() > 0);
+ LTTNG_ASSERT(!_current_field_name.empty());
_description += lttng::format(
"struct {{ }} align({alignment}) {field_name}_padding;\n",
fmt::arg("alignment", type.alignment),
* could wrap nested sequences in structures, which
* would allow us to express alignment constraints.
*/
- LTTNG_ASSERT(_current_field_name.size() > 0);
+ LTTNG_ASSERT(!_current_field_name.empty());
_description += lttng::format(
"struct {{ }} align({alignment}) {field_name}_padding;\n",
fmt::arg("alignment", type.alignment),
void visit_variant(const lst::variant_type<MappingIntegerType>& type)
{
if (type.alignment != 0) {
- LTTNG_ASSERT(_current_field_name.size() > 0);
+ LTTNG_ASSERT(!_current_field_name.empty());
_description += lttng::format(
"struct {{ }} align({alignment}) {field_name}_padding;\n",
fmt::arg("alignment", type.alignment),