Replaced keys, values and reverse with ranges

This commit is contained in:
anurag4u80
2021-03-31 23:33:04 +05:30
parent 851051c64a
commit bbcdddeed9
18 changed files with 56 additions and 53 deletions
+3 -2
View File
@@ -21,9 +21,10 @@
#include <libsolutil/StringUtils.h>
#include <boost/algorithm/string.hpp>
#include <boost/range/adaptor/map.hpp>
#include <boost/throw_exception.hpp>
#include <range/v3/view/map.hpp>
using namespace std;
using namespace solidity::frontend::test;
@@ -97,7 +98,7 @@ void TestCaseReader::ensureAllSettingsRead() const
if (!m_unreadSettings.empty())
BOOST_THROW_EXCEPTION(runtime_error(
"Unknown setting(s): " +
util::joinHumanReadable(m_unreadSettings | boost::adaptors::map_keys)
util::joinHumanReadable(m_unreadSettings | ranges::views::keys)
));
}
+3 -2
View File
@@ -34,9 +34,10 @@
#include <libsolutil/FixedHash.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/algorithm/cxx11/all_of.hpp>
#include <range/v3/view/reverse.hpp>
#include <ostream>
#include <variant>
@@ -332,7 +333,7 @@ void ExpressionEvaluator::evaluateArgs(
vector<u256> values;
size_t i = 0;
/// Function arguments are evaluated in reverse.
for (auto const& expr: _expr | boost::adaptors::reversed)
for (auto const& expr: _expr | ranges::views::reverse)
{
if (!_literalArguments || !_literalArguments->at(_expr.size() - i - 1))
visit(expr);