mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 16:32:47 +00:00
prevector: simplify operator==
This commit is contained in:
parent
01dcb2fcc5
commit
2678abe902
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user