mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-06 17:37:21 +02:00
C++11: Cleaned up column code wiht range-based for
This commit is contained in:
parent
5b675ea834
commit
bd3d58484a
7 changed files with 48 additions and 69 deletions
|
@ -64,9 +64,8 @@ bool ColumnUDA::validate (std::string& value)
|
|||
return true;
|
||||
|
||||
// Look for exact match value.
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = _values.begin (); i != _values.end (); ++i)
|
||||
if (*i == value)
|
||||
for (auto& i : _values)
|
||||
if (i == value)
|
||||
return true;
|
||||
|
||||
// Fail if not found.
|
||||
|
@ -171,9 +170,8 @@ void ColumnUDA::render (
|
|||
std::vector <std::string> raw;
|
||||
wrapText (raw, value, width, _hyphenate);
|
||||
|
||||
std::vector <std::string>::iterator i;
|
||||
for (i = raw.begin (); i != raw.end (); ++i)
|
||||
lines.push_back (color.colorize (leftJustify (*i, width)));
|
||||
for (auto& i : raw)
|
||||
lines.push_back (color.colorize (leftJustify (i, width)));
|
||||
}
|
||||
else if (_type == "numeric")
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue