Duration
- Made list of units static.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user