Address review comments

pull/12762/head
Carlos O'Ryan 2 years ago
parent 0313d61e6f
commit 5ba6b5db1e
  1. 8
      src/google/protobuf/string_block.h

@ -142,11 +142,11 @@ inline size_t StringBlock::NextSize(StringBlock* block) {
}
inline StringBlock* StringBlock::Emplace(void* p, size_t n, StringBlock* next) {
ABSL_DCHECK_EQ(n, NextSize(next));
uint32_t doubled = static_cast<uint32_t>(n) * 2;
const auto count = static_cast<uint32_t>(n);
ABSL_DCHECK_EQ(count, NextSize(next));
uint32_t doubled = count * 2;
uint32_t next_size = next ? std::min(doubled, max_size()) : min_size();
return new (p) StringBlock(
next, false, RoundedSize(static_cast<uint32_t>(n)), next_size);
return new (p) StringBlock(next, false, RoundedSize(count), next_size);
}
inline StringBlock* StringBlock::New(StringBlock* next) {

Loading…
Cancel
Save