@@ -172,25 +172,25 @@ class Field {
172172 * @brief Get the type attributes of the field
173173 * @return The type attributes
174174 */
175- inline const TypeAttributes& type () const { return _type; }
175+ const TypeAttributes& type () const { return _type; }
176176
177177 /* *
178178 * @brief Get the array length of the field
179179 * @return The array length, -1 if not an array
180180 */
181- inline int arrayLength () const { return _array_length; }
181+ int arrayLength () const { return _array_length; }
182182
183183 /* *
184184 * @brief Get the offset of the field in the message. This is only valid if the field is resolved.
185185 * @return The offset in bytes, -1 if not resolved
186186 */
187- inline int offsetInMessage () const { return _offset_in_message_bytes; }
187+ int offsetInMessage () const { return _offset_in_message_bytes; }
188188
189189 /* *
190190 * @brief Get the name of the field
191191 * @return The name
192192 */
193- inline const std::string& name () const { return _name; }
193+ const std::string& name () const { return _name; }
194194
195195 /* *
196196 * @brief Get the size of the field in bytes. This is only valid if the field is resolved.
@@ -203,11 +203,11 @@ class Field {
203203 * is defined and the type is not nested or the nested message is resolved.
204204 * @return True if the field is resolved
205205 */
206- inline bool definitionResolved () const
206+ bool definitionResolved () const
207207 {
208208 return _offset_in_message_bytes >= 0 &&
209209 (_type.type != BasicType::NESTED || _type.nested_message != nullptr );
210- };
210+ }
211211
212212 /* *
213213 * @brief Attempt to resolve the definition of the field.
@@ -353,8 +353,8 @@ class Value {
353353 // this is natively a vector
354354 if constexpr (is_vector<ReturnType>::value) {
355355 // return type is also vector
356- if constexpr (std::is_same <typename NativeType::value_type,
357- typename ReturnType::value_type>::value ) {
356+ if constexpr (std::is_same_v <typename NativeType::value_type,
357+ typename ReturnType::value_type>) {
358358 // return type is same as native type
359359 res = arg;
360360 } else {
@@ -428,7 +428,7 @@ class Value {
428428 int array_offset)
429429 {
430430 T v;
431- int total_offset = offset + array_offset * sizeof (T);
431+ const int total_offset = offset + ( array_offset * sizeof (T) );
432432 if (backing_start > backing_end ||
433433 backing_end - backing_start < static_cast <int64_t >(sizeof (v)) + total_offset) {
434434 throw AccessException (" Unexpected data type size" );
@@ -603,6 +603,7 @@ class MessageFormat {
603603 std::vector<std::string> fieldNames () const
604604 {
605605 std::vector<std::string> names;
606+ names.reserve (_fields_ordered.size ());
606607 for (const auto & field_it : _fields_ordered) {
607608 names.push_back (field_it->name ());
608609 }
0 commit comments