mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Apply modernize-pass-by-value.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <ostream>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
namespace solidity::evmasm
|
||||
{
|
||||
@@ -119,7 +120,7 @@ public:
|
||||
struct GasConsumption
|
||||
{
|
||||
GasConsumption(unsigned _value = 0, bool _infinite = false): value(_value), isInfinite(_infinite) {}
|
||||
GasConsumption(u256 _value, bool _infinite = false): value(_value), isInfinite(_infinite) {}
|
||||
GasConsumption(u256 _value, bool _infinite = false): value(std::move(_value)), isInfinite(_infinite) {}
|
||||
static GasConsumption infinite() { return GasConsumption(0, true); }
|
||||
|
||||
GasConsumption& operator+=(GasConsumption const& _other);
|
||||
@@ -133,8 +134,8 @@ public:
|
||||
};
|
||||
|
||||
/// Constructs a new gas meter given the current state.
|
||||
GasMeter(std::shared_ptr<KnownState> const& _state, langutil::EVMVersion _evmVersion, u256 const& _largestMemoryAccess = 0):
|
||||
m_state(_state), m_evmVersion(_evmVersion), m_largestMemoryAccess(_largestMemoryAccess) {}
|
||||
GasMeter(std::shared_ptr<KnownState> _state, langutil::EVMVersion _evmVersion, u256 _largestMemoryAccess = 0):
|
||||
m_state(std::move(_state)), m_evmVersion(_evmVersion), m_largestMemoryAccess(std::move(_largestMemoryAccess)) {}
|
||||
|
||||
/// @returns an upper bound on the gas consumed by the given instruction and updates
|
||||
/// the state.
|
||||
|
||||
Reference in New Issue
Block a user