mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix comparison operator for GasConsumption.
This commit is contained in:
parent
12045d2e11
commit
1fed3519e1
@ -112,9 +112,10 @@ public:
|
|||||||
static GasConsumption infinite() { return GasConsumption(0, true); }
|
static GasConsumption infinite() { return GasConsumption(0, true); }
|
||||||
|
|
||||||
GasConsumption& operator+=(GasConsumption const& _other);
|
GasConsumption& operator+=(GasConsumption const& _other);
|
||||||
bool operator<(GasConsumption const& _other) const { return this->tuple() < _other.tuple(); }
|
bool operator<(GasConsumption const& _other) const
|
||||||
|
{
|
||||||
std::tuple<bool const&, u256 const&> tuple() const { return std::tie(isInfinite, value); }
|
return std::make_pair(isInfinite, value) < std::make_pair(_other.isInfinite, _other.value);
|
||||||
|
}
|
||||||
|
|
||||||
u256 value;
|
u256 value;
|
||||||
bool isInfinite;
|
bool isInfinite;
|
||||||
|
Loading…
Reference in New Issue
Block a user