mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Code Cleanup
- Used the shorter form of std::string::substr that defaults the second argument to std::string::npos.
This commit is contained in:
parent
75e738a9c9
commit
2cf25b7c35
14 changed files with 41 additions and 43 deletions
|
@ -519,22 +519,22 @@ void TDB::undo ()
|
|||
// pop last tx
|
||||
u.pop_back (); // separator.
|
||||
|
||||
std::string current = u.back ().substr (4, std::string::npos);
|
||||
std::string current = u.back ().substr (4);
|
||||
u.pop_back ();
|
||||
|
||||
std::string prior;
|
||||
std::string when;
|
||||
if (u.back ().substr (0, 5) == "time ")
|
||||
{
|
||||
when = u.back ().substr (5, std::string::npos);
|
||||
when = u.back ().substr (5);
|
||||
u.pop_back ();
|
||||
prior = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
prior = u.back ().substr (4, std::string::npos);
|
||||
prior = u.back ().substr (4);
|
||||
u.pop_back ();
|
||||
when = u.back ().substr (5, std::string::npos);
|
||||
when = u.back ().substr (5);
|
||||
u.pop_back ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue