diff --git a/source/extensions/filters/network/zookeeper_proxy/utils.cc b/source/extensions/filters/network/zookeeper_proxy/utils.cc index ec2d524ee584..ed79ecba75ba 100644 --- a/source/extensions/filters/network/zookeeper_proxy/utils.cc +++ b/source/extensions/filters/network/zookeeper_proxy/utils.cc @@ -10,7 +10,7 @@ namespace ZooKeeperProxy { int32_t BufferHelper::peekInt32(Buffer::Instance& buffer, uint64_t& offset) { ensureMaxLen(sizeof(int32_t)); - int32_t val = buffer.peekBEInt(offset); + const int32_t val = buffer.peekBEInt(offset); offset += sizeof(int32_t); return val; } @@ -18,7 +18,7 @@ int32_t BufferHelper::peekInt32(Buffer::Instance& buffer, uint64_t& offset) { int64_t BufferHelper::peekInt64(Buffer::Instance& buffer, uint64_t& offset) { ensureMaxLen(sizeof(int64_t)); - int64_t val = buffer.peekBEInt(offset); + const int64_t val = buffer.peekBEInt(offset); offset += sizeof(int64_t); return val; } @@ -34,7 +34,7 @@ bool BufferHelper::peekBool(Buffer::Instance& buffer, uint64_t& offset) { std::string BufferHelper::peekString(Buffer::Instance& buffer, uint64_t& offset) { std::string val; - uint32_t len = peekInt32(buffer, offset); + const uint32_t len = peekInt32(buffer, offset); if (len == 0) { return val; diff --git a/source/extensions/filters/network/zookeeper_proxy/utils.h b/source/extensions/filters/network/zookeeper_proxy/utils.h index ad210a8150f4..7ce749ed8641 100644 --- a/source/extensions/filters/network/zookeeper_proxy/utils.h +++ b/source/extensions/filters/network/zookeeper_proxy/utils.h @@ -37,7 +37,7 @@ class BufferHelper : public Logger::Loggable { private: void ensureMaxLen(uint32_t size); - uint32_t max_len_; + const uint32_t max_len_; uint32_t current_{}; };