MCPcopy Create free account
hub / github.com/argotorg/solidity / gasOrNullopt

Function gasOrNullopt

test/libsolidity/util/TestFunctionCall.cpp:360–367  ·  view source on GitHub ↗

TODO: Convert this into a generic helper for getting optional form a map

Source from the content-addressed store, hash-verified

358
359// TODO: Convert this into a generic helper for getting optional form a map
360std::optional<u256> gasOrNullopt(std::map<std::string, u256> const& _map, std::string const& _key)
361{
362 auto it = _map.find(_key);
363 if (it == _map.end())
364 return std::nullopt;
365
366 return it->second;
367}
368
369}
370

Callers 1

formatGasExpectationsMethod · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected