mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-12 02:07:39 +01:00
coinselection: Remove COutput operators == and !=
These operators are used only by the tests in std::mismatch. As std::mismatch can take a binary predicate, we can use a lambda that achieves the same instead.
This commit is contained in:
parent
f6c39c6adb
commit
049003fe68
2 changed files with 4 additions and 9 deletions
|
@ -84,14 +84,6 @@ public:
|
||||||
bool operator<(const COutput& rhs) const {
|
bool operator<(const COutput& rhs) const {
|
||||||
return outpoint < rhs.outpoint;
|
return outpoint < rhs.outpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const COutput& rhs) const {
|
|
||||||
return outpoint != rhs.outpoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator==(const COutput& rhs) const {
|
|
||||||
return outpoint == rhs.outpoint;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Parameters for one iteration of Coin Selection. */
|
/** Parameters for one iteration of Coin Selection. */
|
||||||
|
|
|
@ -113,7 +113,10 @@ static bool EquivalentResult(const SelectionResult& a, const SelectionResult& b)
|
||||||
/** Check if this selection is equal to another one. Equal means same inputs (i.e same value and prevout) */
|
/** Check if this selection is equal to another one. Equal means same inputs (i.e same value and prevout) */
|
||||||
static bool EqualResult(const SelectionResult& a, const SelectionResult& b)
|
static bool EqualResult(const SelectionResult& a, const SelectionResult& b)
|
||||||
{
|
{
|
||||||
std::pair<CoinSet::iterator, CoinSet::iterator> ret = std::mismatch(a.GetInputSet().begin(), a.GetInputSet().end(), b.GetInputSet().begin());
|
std::pair<CoinSet::iterator, CoinSet::iterator> ret = std::mismatch(a.GetInputSet().begin(), a.GetInputSet().end(), b.GetInputSet().begin(),
|
||||||
|
[](const COutput& a, const COutput& b) {
|
||||||
|
return a.outpoint == b.outpoint;
|
||||||
|
});
|
||||||
return ret.first == a.GetInputSet().end() && ret.second == b.GetInputSet().end();
|
return ret.first == a.GetInputSet().end() && ret.second == b.GetInputSet().end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue