Revert "[clang-tidy] Use new range based loops"

This reverts commit a468537c1b.
This commit is contained in:
Paul Beckingham
2020-12-05 16:18:15 -05:00
parent e3e158bf6a
commit 0a3a4d364d
4 changed files with 20 additions and 20 deletions

View File

@@ -195,8 +195,8 @@ void Eval::debug (bool value)
std::vector <std::string> Eval::getOperators ()
{
std::vector <std::string> all;
for (auto & i : operators)
all.push_back (i.op);
for (unsigned int i = 0; i < NUM_OPERATORS; ++i)
all.push_back (operators[i].op);
return all;
}
@@ -206,9 +206,9 @@ std::vector <std::string> Eval::getOperators ()
std::vector <std::string> Eval::getBinaryOperators ()
{
std::vector <std::string> all;
for (auto & i : operators)
if (i.type == 'b')
all.push_back (i.op);
for (unsigned int i = 0; i < NUM_OPERATORS; ++i)
if (operators[i].type == 'b')
all.push_back (operators[i].op);
return all;
}
@@ -338,9 +338,9 @@ void Eval::evaluatePostfixStack (
case Lexer::Type::identifier:
{
bool found = false;
for (auto _source : _sources)
for (auto source = _sources.begin (); source != _sources.end (); ++source)
{
if (_source (token.first, v))
if ((*source) (token.first, v))
{
if (_debug)
Context::getContext ().debug (format ("Eval identifier source '{1}' → ↑'{2}'", token.first, (std::string) v));
@@ -669,10 +669,10 @@ bool Eval::parsePrimitive (
else
{
bool found = false;
for (auto _source : _sources)
for (auto source = _sources.begin (); source != _sources.end (); ++source)
{
Variant v;
if (_source (infix[i].first, v))
if ((*source) (infix[i].first, v))
{
found = true;
break;
@@ -810,13 +810,13 @@ bool Eval::identifyOperator (
unsigned int& precedence,
char& associativity) const
{
for (auto & i : operators)
for (unsigned int i = 0; i < NUM_OPERATORS; ++i)
{
if (i.op == op)
if (operators[i].op == op)
{
type = i.type;
precedence = i.precedence;
associativity = i.associativity;
type = operators[i].type;
precedence = operators[i].precedence;
associativity = operators[i].associativity;
return true;
}
}