diff options
author | chriseth <c@ethdev.com> | 2015-05-06 19:56:40 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-05-06 19:56:40 +0800 |
commit | c731ae92ca68c2e2cdf761bdf1f81e27097e50fc (patch) | |
tree | a9b3ab8594588f65e325dd011d98602b253772ba /StructuralGasEstimator.h | |
parent | c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b (diff) | |
download | dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.gz dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.bz2 dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.lz dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.xz dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.zst dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.zip |
Use std::array.
Diffstat (limited to 'StructuralGasEstimator.h')
-rw-r--r-- | StructuralGasEstimator.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/StructuralGasEstimator.h b/StructuralGasEstimator.h index b9e97643..df1ae509 100644 --- a/StructuralGasEstimator.h +++ b/StructuralGasEstimator.h @@ -24,6 +24,7 @@ #include <vector> #include <map> +#include <array> #include <libsolidity/ASTForward.h> #include <libevmasm/GasMeter.h> #include <libevmasm/Assembly.h> @@ -37,11 +38,13 @@ class StructuralGasEstimator { public: using ASTGasConsumption = std::map<ASTNode const*, eth::GasMeter::GasConsumption>; + using ASTGasConsumptionSelfAccumulated = + std::map<ASTNode const*, std::array<eth::GasMeter::GasConsumption, 2>>; /// Estimates the gas consumption for every assembly item in the given assembly and stores /// it by source location. /// @returns a mapping from each AST node to a pair of its particular and syntactically accumulated gas costs. - std::map<ASTNode const*, eth::GasMeter::GasConsumption[2]> performEstimation( + ASTGasConsumptionSelfAccumulated performEstimation( eth::AssemblyItems const& _items, std::vector<ASTNode const*> const& _ast ); @@ -50,7 +53,7 @@ public: /// 1. source locations of statements that do not contain other statements /// 2. maximal source locations that do not overlap locations coming from the first rule ASTGasConsumption breakToStatementLevel( - std::map<ASTNode const*, eth::GasMeter::GasConsumption[2]> const& _gasCosts, + ASTGasConsumptionSelfAccumulated const& _gasCosts, std::vector<ASTNode const*> const& _roots ); }; |