mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 02:33:03 +00:00
c++: use resize to shrink a vector
Suggested by Adrian Vogelsgesang. https://lists.gnu.org/archive/html/bison-patches/2019-08/msg00009.html * data/skeletons/lalr1.cc (yy_lac_check_): here.
This commit is contained in:
@@ -1182,8 +1182,7 @@ b4_dollar_popdef])[]dnl
|
|||||||
size_t lac_size = yylac_stack_.size ();
|
size_t lac_size = yylac_stack_.size ();
|
||||||
if (yylen < lac_size)
|
if (yylen < lac_size)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < yylen; ++i)
|
yylac_stack_.resize (lac_size - yylen);
|
||||||
yylac_stack_.pop_back ();
|
|
||||||
yylen = 0;
|
yylen = 0;
|
||||||
}
|
}
|
||||||
else if (lac_size)
|
else if (lac_size)
|
||||||
|
|||||||
Reference in New Issue
Block a user