diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index eba9868929c6d..85ed0b2691ebb 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -505,7 +505,7 @@ template inline RepeatedField::RepeatedField(const RepeatedField& rhs) : current_size_(0), total_size_(0), arena_or_elements_(nullptr) { StaticValidityCheck(); - if (size_t size = rhs.current_size_) { + if (auto size = rhs.current_size_) { Grow(0, size); ExchangeCurrentSize(size); UninitializedCopyN(rhs.elements(), size, unsafe_elements()); @@ -786,7 +786,7 @@ inline void RepeatedField::Clear() { template inline void RepeatedField::MergeFrom(const RepeatedField& rhs) { ABSL_DCHECK_NE(&rhs, this); - if (size_t size = rhs.current_size_) { + if (auto size = rhs.current_size_) { Reserve(current_size_ + size); Element* dst = elements() + ExchangeCurrentSize(current_size_ + size); UninitializedCopyN(rhs.elements(), size, dst);