Don't use != in InlinedVector::==

pull/19851/head
Juanli Shen 5 years ago
parent 6ba7d2c21d
commit 00793c1c78
  1. 4
      src/core/lib/gprpp/inlined_vector.h

@ -100,7 +100,9 @@ class InlinedVector {
bool operator==(const InlinedVector& other) const { bool operator==(const InlinedVector& other) const {
if (size_ != other.size_) return false; if (size_ != other.size_) return false;
for (size_t i = 0; i < size_; ++i) { for (size_t i = 0; i < size_; ++i) {
if (data()[i] != other.data()[i]) return false; // Note that this uses == instead of != so that the data class doesn't
// have to implement !=.
if (!(data()[i] == other.data()[i])) return false;
} }
return true; return true;
} }

Loading…
Cancel
Save