Merge bitcoin/bitcoin#33772: prevector: simplify operator==

2678abe902c69ab5af5450d6fdf40ead834b1e26 prevector: simplify `operator==` (Daniel Pfeifer)

Pull request description:

  The reduced amount of code reduces maintenance.

ACKs for top commit:
  maflcko:
    lgtm ACK 2678abe902c69ab5af5450d6fdf40ead834b1e26
  l0rinc:
    Tested ACK 2678abe902c69ab5af5450d6fdf40ead834b1e26
  sedited:
    ACK 2678abe902c69ab5af5450d6fdf40ead834b1e26
  stickies-v:
    ACK 2678abe902c69ab5af5450d6fdf40ead834b1e26

Tree-SHA512: 0646b055314944e1457cc434b90a533b6a9f0b48801410b77e031c1f05451a6cd3269350e6e2cead86de9add0ba86339df36f69e9630d686505218717112737b
This commit is contained in:
merge-script 2026-03-11 09:39:05 +01:00
commit 410f2a0d20
No known key found for this signature in database
GPG Key ID: 9B79B45691DB4173

View File

@ -426,21 +426,8 @@ public:
}
}
bool operator==(const prevector<N, T, Size, Diff>& 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<N, T, Size, Diff>& other) const {