Skip to content

Commit

Permalink
inline initialize byte_width
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaileychess committed Dec 7, 2022
1 parent aadc4cb commit 0e79e56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/flatbuffers/flexbuffers.h
Expand Up @@ -383,9 +383,10 @@ class Reference {
type_(type) {}

Reference(const uint8_t *data, uint8_t parent_width, uint8_t packed_type)
: data_(data), parent_width_(parent_width) {
byte_width_ = static_cast<BitWidth>(1U << (packed_type & 3));
type_ = static_cast<Type>(packed_type >> 2);
: data_(data),
parent_width_(parent_width),
byte_width_(1 << (packed_type & 3)),
type_(static_cast<Type>(packed_type >> 2)) {
}

Type GetType() const { return type_; }
Expand Down

0 comments on commit 0e79e56

Please sign in to comment.