From 2678abe902c69ab5af5450d6fdf40ead834b1e26 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Mon, 3 Nov 2025 15:10:05 +0100 Subject: [PATCH] prevector: simplify `operator==` --- src/prevector.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/prevector.h b/src/prevector.h index d4d90c7350f..91be488039e 100644 --- a/src/prevector.h +++ b/src/prevector.h @@ -426,21 +426,8 @@ public: } } - bool operator==(const prevector& other) const { - if (other.size() != size()) { - return false; - } - const_iterator b1 = begin(); - const_iterator b2 = other.begin(); - const_iterator e1 = end(); - while (b1 != e1) { - if ((*b1) != (*b2)) { - return false; - } - ++b1; - ++b2; - } - return true; + constexpr bool operator==(const prevector& other) const { + return std::ranges::equal(*this, other); } bool operator<(const prevector& other) const {