mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Duration
- Made list of units static.
This commit is contained in:
parent
4118fe70ae
commit
c9d61ff71b
1 changed files with 5 additions and 4 deletions
|
@ -284,10 +284,11 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
|
||||||
std::string::size_type original_start = start;
|
std::string::size_type original_start = start;
|
||||||
Nibbler n (input.substr (start));
|
Nibbler n (input.substr (start));
|
||||||
|
|
||||||
// TODO This can be made static, and so preserved between calls.
|
// Static and so preserved between calls.
|
||||||
std::vector <std::string> units;
|
static std::vector <std::string> units;
|
||||||
for (int i = 0; i < NUM_DURATIONS; i++)
|
if (units.size () == 0)
|
||||||
units.push_back (durations[i].unit);
|
for (int i = 0; i < NUM_DURATIONS; i++)
|
||||||
|
units.push_back (durations[i].unit);
|
||||||
|
|
||||||
std::string number;
|
std::string number;
|
||||||
std::string unit;
|
std::string unit;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue