mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
C++11: Cleaned up program framework with range-based for
This commit is contained in:
parent
5a57dfd70d
commit
e74c6963a9
28 changed files with 937 additions and 1221 deletions
|
@ -536,10 +536,9 @@ int Date::length (const std::string& format)
|
|||
{
|
||||
int total = 0;
|
||||
|
||||
std::string::const_iterator i;
|
||||
for (i = format.begin (); i != format.end (); ++i)
|
||||
for (auto& i : format)
|
||||
{
|
||||
switch (*i)
|
||||
switch (i)
|
||||
{
|
||||
case 'm':
|
||||
case 'M':
|
||||
|
@ -563,7 +562,7 @@ int Date::length (const std::string& format)
|
|||
case 'B': total += 10; break;
|
||||
|
||||
// Calculate the width, don't assume a single character width.
|
||||
default: total += mk_wcwidth (*i); break;
|
||||
default: total += mk_wcwidth (i); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue