Merge pull request #4473 from ethereum/fixGasTuple

Fix comparison operator for GasConsumption.
This commit is contained in:
chriseth 2018-07-11 11:55:19 +02:00 committed by GitHub
commit 28ac3f0a6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,9 +112,10 @@ public:
static GasConsumption infinite() { return GasConsumption(0, true); }
GasConsumption& operator+=(GasConsumption const& _other);
bool operator<(GasConsumption const& _other) const { return this->tuple() < _other.tuple(); }
std::tuple<bool const&, u256 const&> tuple() const { return std::tie(isInfinite, value); }
bool operator<(GasConsumption const& _other) const
{
return std::make_pair(isInfinite, value) < std::make_pair(_other.isInfinite, _other.value);
}
u256 value;
bool isInfinite;