C++11: Cleaned up commands code with range-based for

This commit is contained in:
Paul Beckingham 2015-05-11 17:45:15 -04:00
parent bd3d58484a
commit 5a57dfd70d
42 changed files with 911 additions and 1065 deletions

View file

@ -45,9 +45,8 @@ CmdUndo::CmdUndo ()
int CmdUndo::execute (std::string& output)
{
// Detect attempts to modify the task.
std::vector <A>::iterator a;
for (a = context.cli._args.begin (); a != context.cli._args.end (); ++a)
if (a->hasTag ("MODIFICATION"))
for (auto& a : context.cli._args)
if (a.hasTag ("MODIFICATION"))
throw std::string (STRING_CMD_UNDO_MODS);
context.tdb2.revert ();