mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-27 20:31:52 +02:00
CompareFeerateDiagram: short-circuit comparison when detected as incomparable
This commit is contained in:
parent
cebcced65e
commit
a9d42b9aa5
@ -76,10 +76,12 @@ std::partial_ordering CompareFeerateDiagram(Span<const FeeFrac> dia0, Span<const
|
|||||||
if (std::is_gt(cmp)) better_somewhere[unproc_side] = true;
|
if (std::is_gt(cmp)) better_somewhere[unproc_side] = true;
|
||||||
if (std::is_lt(cmp)) better_somewhere[!unproc_side] = true;
|
if (std::is_lt(cmp)) better_somewhere[!unproc_side] = true;
|
||||||
++next_index[unproc_side];
|
++next_index[unproc_side];
|
||||||
|
|
||||||
|
// If both diagrams are better somewhere, they are incomparable.
|
||||||
|
if (better_somewhere[0] && better_somewhere[1]) return std::partial_ordering::unordered;
|
||||||
|
|
||||||
} while(true);
|
} while(true);
|
||||||
|
|
||||||
// If both diagrams are better somewhere, they are incomparable.
|
|
||||||
if (better_somewhere[0] && better_somewhere[1]) return std::partial_ordering::unordered;
|
|
||||||
// Otherwise compare the better_somewhere values.
|
// Otherwise compare the better_somewhere values.
|
||||||
return better_somewhere[0] <=> better_somewhere[1];
|
return better_somewhere[0] <=> better_somewhere[1];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user