aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-07-11 17:55:19 +0800
committerGitHub <noreply@github.com>2018-07-11 17:55:19 +0800
commit28ac3f0a6c8c532e79aaa3bff1e1a7d8ac7d8cb0 (patch)
tree053ab3983e1ad3c573fc76f333b1c64d7a57f284 /libevmasm
parent07910c80cb42a717212cf6b0a4c405eff20e6051 (diff)
parent1fed3519e1f8d04620a64e415770a0cb55804d04 (diff)
downloaddexon-solidity-28ac3f0a6c8c532e79aaa3bff1e1a7d8ac7d8cb0.tar.gz
dexon-solidity-28ac3f0a6c8c532e79aaa3bff1e1a7d8ac7d8cb0.tar.zst
dexon-solidity-28ac3f0a6c8c532e79aaa3bff1e1a7d8ac7d8cb0.zip
Merge pull request #4473 from ethereum/fixGasTuple
Fix comparison operator for GasConsumption.
Diffstat (limited to 'libevmasm')
-rw-r--r--libevmasm/GasMeter.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h
index b131802f..fc3740d2 100644
--- a/libevmasm/GasMeter.h
+++ b/libevmasm/GasMeter.h
@@ -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;