Minor simplification using std::vector::emplace_back()

master
Sébastien Villemot 2022-07-19 23:13:16 +02:00
parent 435e56369c
commit c0bfc99946
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 4 additions and 4 deletions

View File

@ -1288,13 +1288,13 @@ period_list : period_list COMMA INT_NUMBER
{
$$ = $1;
int p = stoi($3);
$$.push_back({ p, p });
$$.emplace_back(p, p);
}
| period_list INT_NUMBER
{
$$ = $1;
int p = stoi($2);
$$.push_back({ p, p });
$$.emplace_back(p, p);
}
| period_list COMMA INT_NUMBER ':' INT_NUMBER
{
@ -1302,7 +1302,7 @@ period_list : period_list COMMA INT_NUMBER
int p1 = stoi($3), p2 = stoi($5);
if (p1 > p2)
driver.error("Can't have first period index greater than second index in range specification");
$$.push_back({ p1, p2 });
$$.emplace_back(p1, p2);
}
| period_list INT_NUMBER ':' INT_NUMBER
{
@ -1310,7 +1310,7 @@ period_list : period_list COMMA INT_NUMBER
int p1 = stoi($2), p2 = stoi($4);
if (p1 > p2)
driver.error("Can't have first period index greater than second index in range specification");
$$.push_back({ p1, p2 });
$$.emplace_back(p1, p2);
}
| INT_NUMBER ':' INT_NUMBER
{