mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 21:57:54 +02:00
Merge bitcoin/bitcoin#33772: prevector: simplify operator==
2678abe902prevector: simplify `operator==` (Daniel Pfeifer) Pull request description: The reduced amount of code reduces maintenance. ACKs for top commit: maflcko: lgtm ACK2678abe902l0rinc: Tested ACK2678abe902sedited: ACK2678abe902stickies-v: ACK2678abe902Tree-SHA512: 0646b055314944e1457cc434b90a533b6a9f0b48801410b77e031c1f05451a6cd3269350e6e2cead86de9add0ba86339df36f69e9630d686505218717112737b
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user