Fix `final_is_soo` being accidentally declared as int not bool.

This check did behave correctly but causes warnings about comparing int and bool.

PiperOrigin-RevId: 667987307
pull/17965/head
Protobuf Team Bot 3 months ago committed by Copybara-Service
parent 45f65d123f
commit ede55fec7d
  1. 4
      src/google/protobuf/repeated_field.h

@ -858,7 +858,7 @@ inline void RepeatedField<Element>::Add(Element value) {
// The below helps the compiler optimize dense loops.
// Note: we can't call functions in PROTOBUF_ASSUME so use local variables.
ABSL_ATTRIBUTE_UNUSED const int final_is_soo = this->is_soo();
ABSL_ATTRIBUTE_UNUSED const bool final_is_soo = this->is_soo();
PROTOBUF_ASSUME(is_soo == final_is_soo);
ABSL_ATTRIBUTE_UNUSED const int final_size = size(is_soo);
PROTOBUF_ASSUME(new_size == final_size);
@ -898,7 +898,7 @@ inline void RepeatedField<Element>::AddForwardIterator(Iter begin, Iter end) {
// The below helps the compiler optimize dense loops.
// Note: we can't call functions in PROTOBUF_ASSUME so use local variables.
ABSL_ATTRIBUTE_UNUSED const int final_is_soo = this->is_soo();
ABSL_ATTRIBUTE_UNUSED const bool final_is_soo = this->is_soo();
PROTOBUF_ASSUME(is_soo == final_is_soo);
ABSL_ATTRIBUTE_UNUSED const int final_size = size(is_soo);
PROTOBUF_ASSUME(new_size == final_size);

Loading…
Cancel
Save