mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-27 21:23:25 +02:00
C++11: Cleaned up commands code with range-based for
This commit is contained in:
parent
bd3d58484a
commit
5a57dfd70d
42 changed files with 911 additions and 1065 deletions
|
@ -62,20 +62,19 @@ int CmdUrgency::execute (std::string& output)
|
|||
|
||||
// Display urgency for the selected tasks.
|
||||
std::stringstream out;
|
||||
std::vector <Task>::iterator task;
|
||||
for (task = filtered.begin (); task != filtered.end (); ++task)
|
||||
for (auto& task : filtered)
|
||||
{
|
||||
if (task->id)
|
||||
if (task.id)
|
||||
{
|
||||
out << format (STRING_CMD_URGENCY_RESULT,
|
||||
task->id, task->urgency ())
|
||||
task.id, task.urgency ())
|
||||
<< "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
out << format (STRING_CMD_URGENCY_RESULT,
|
||||
task->get ("uuid"),
|
||||
task->urgency ())
|
||||
task.get ("uuid"),
|
||||
task.urgency ())
|
||||
<< "\n";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue