Remove once-off helper in ConstantOptimiser

For clarity. Makes code easier to understand.
This commit is contained in:
Alex Beregszaszi 2019-01-28 15:44:41 +00:00
parent 2fc7928697
commit 4aa2d965dc
2 changed files with 1 additions and 3 deletions

View File

@ -129,7 +129,7 @@ bigint LiteralMethod::gasNeeded() const
return combineGas(
simpleRunGas({Instruction::PUSH1}),
// PUSHX plus data
(m_params.isCreation ? GasCosts::txDataNonZeroGas : GasCosts::createDataGas) + dataGas(),
(m_params.isCreation ? GasCosts::txDataNonZeroGas : GasCosts::createDataGas) + dataGas(toCompactBigEndian(m_value, 1)),
0
);
}

View File

@ -79,8 +79,6 @@ protected:
static bigint simpleRunGas(AssemblyItems const& _items);
/// @returns the gas needed to store the given data literally
bigint dataGas(bytes const& _data) const;
/// @returns the gas needed to store the value literally
bigint dataGas() const { return dataGas(toCompactBigEndian(m_value, 1)); }
static size_t bytesRequired(AssemblyItems const& _items);
/// @returns the combined estimated gas usage taking @a m_params into account.
bigint combineGas(