From 00793c1c786cfc3091f3ee1f382b5dd4a9087e93 Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Mon, 5 Aug 2019 15:42:05 -0700 Subject: [PATCH] Don't use != in InlinedVector::== --- src/core/lib/gprpp/inlined_vector.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/lib/gprpp/inlined_vector.h b/src/core/lib/gprpp/inlined_vector.h index ffc37387ec3..f511d520f50 100644 --- a/src/core/lib/gprpp/inlined_vector.h +++ b/src/core/lib/gprpp/inlined_vector.h @@ -100,7 +100,9 @@ class InlinedVector { bool operator==(const InlinedVector& other) const { if (size_ != other.size_) return false; 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; }