Cleanup: Removed 'const auto', which is implied by the container

This commit is contained in:
Paul Beckingham 2016-04-05 22:55:18 -04:00
parent ed5c155051
commit 2a47f769cd
5 changed files with 11 additions and 11 deletions

View file

@ -98,12 +98,12 @@ std::string A2::dump () const
// Dump attributes.
std::string atts;
for (const auto& a : _attributes)
for (auto& a : _attributes)
atts += a.first + "='\033[33m" + a.second + "\033[0m' ";
// Dump tags.
std::string tags;
for (const auto& tag : _tags)
for (auto& tag : _tags)
{
if (tag == "BINARY") tags += "\033[1;37;44m" + tag + "\033[0m ";
else if (tag == "CMD") tags += "\033[1;37;46m" + tag + "\033[0m ";
@ -233,7 +233,7 @@ void CLI::analyze ()
std::vector <std::string> CLI::getWords () const
{
std::vector <std::string> words;
for (const auto& a : _args)
for (auto& a : _args)
if (! a.hasTag ("BINARY") &&
! a.hasTag ("CMD") &&
! a.hasTag ("HINT"))
@ -287,7 +287,7 @@ std::string CLI::getBinary () const
////////////////////////////////////////////////////////////////////////////////
std::string CLI::getCommand () const
{
for (const auto& a : _args)
for (auto& a : _args)
if (a.hasTag ("CMD"))
return a.attribute ("canonical");
@ -316,7 +316,7 @@ std::string CLI::dump (const std::string& title) const
if (_args.size ())
{
out << " _args\n";
for (const auto& a : _args)
for (auto& a : _args)
out << " " << a.dump () << "\n";
}

View file

@ -139,7 +139,7 @@ std::string Database::dump () const
{
std::stringstream out;
out << "Database\n";
for (const auto& file : _files)
for (auto& file : _files)
out << " Datafile: " << file.name ()
<< (file.name () == _current ? " (current)" : "")
<< "\n";

View file

@ -75,7 +75,7 @@ std::string Extensions::dump () const
std::stringstream out;
out << "Extensions\n";
for (const auto& script : _scripts)
for (auto& script : _scripts)
out << " " << script << "\n";
return out.str ();

View file

@ -217,7 +217,7 @@ std::string Interval::dump () const
<< _end.toEpoch ()
<< "' _tags";
for (const auto& tag : _tags)
for (auto& tag : _tags)
out << " '" << tag << "'";
out << "\n";

View file

@ -152,7 +152,7 @@ void Rules::set (const std::string& key, const std::string& value)
std::vector <std::string> Rules::all (const std::string& stem) const
{
std::vector <std::string> items;
for (const auto& it : _settings)
for (auto& it : _settings)
if (stem == "" || it.first.find (stem) == 0)
items.push_back (it.first);
@ -168,7 +168,7 @@ std::string Rules::dump () const
<< "\n";
out << " Settings\n";
for (const auto& item : _settings)
for (auto& item : _settings)
out << " " << item.first << "=" << item.second << "\n";
return out.str ();
@ -256,7 +256,7 @@ void Rules::parse (const std::string& input, int nest /* = 1 */)
{
// Extract the words from the 3rd - Nth tuple.
std::vector <std::string> words;
for (const auto& token : std::vector <std::tuple <std::string, Lexer::Type>> (tokens.begin () + 2, tokens.end ()))
for (auto& token : std::vector <std::tuple <std::string, Lexer::Type>> (tokens.begin () + 2, tokens.end ()))
words.push_back (std::get <0> (token));
set (firstWord, join (" ", words));