Skip to content

Commit

Permalink
Remove asserts from VarArray<T>::get_vararr_size and get_vararr_size(…
Browse files Browse the repository at this point in the history
…VarArray<T>)
  • Loading branch information
ameharoo committed Aug 26, 2024
1 parent 55c38f0 commit 8fc3420
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions templates/cpp/VarArray.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@ struct {{ msg_type }} {
}

static constexpr std::int32_t get_vararr_size(std::uint16_t size) {
assert(size > 0);
return sizeof({{ msg_type }}) + (size - 1) * {{ T_Message.get_sizeof_method(T) }};
}
};

std::int32_t get_vararr_size(const {{ msg_type }}& arr) {
assert(arr.size > 0);
return sizeof({{ msg_type }}) + (arr.size - 1) * {{ T_Message.get_sizeof_method("arr.values[0]") }};
}
#pragma pack(pop)

0 comments on commit 8fc3420

Please sign in to comment.