- Made list of units static.
This commit is contained in:
Paul Beckingham 2015-03-06 21:15:50 -05:00
parent 4118fe70ae
commit c9d61ff71b

View file

@ -284,8 +284,9 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
std::string::size_type original_start = start;
Nibbler n (input.substr (start));
// TODO This can be made static, and so preserved between calls.
std::vector <std::string> units;
// Static and so preserved between calls.
static std::vector <std::string> units;
if (units.size () == 0)
for (int i = 0; i < NUM_DURATIONS; i++)
units.push_back (durations[i].unit);