From 0e79e56427964bb20130eb393a8ce321d94bad76 Mon Sep 17 00:00:00 2001 From: Derek Bailey Date: Tue, 6 Dec 2022 22:18:11 -0800 Subject: [PATCH] inline initialize byte_width --- include/flatbuffers/flexbuffers.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/flatbuffers/flexbuffers.h b/include/flatbuffers/flexbuffers.h index 838f94be5..3ab7b5ab6 100644 --- a/include/flatbuffers/flexbuffers.h +++ b/include/flatbuffers/flexbuffers.h @@ -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(1U << (packed_type & 3)); - type_ = static_cast(packed_type >> 2); + : data_(data), + parent_width_(parent_width), + byte_width_(1 << (packed_type & 3)), + type_(static_cast(packed_type >> 2)) { } Type GetType() const { return type_; }