mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-10-18 13:43:27 +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:
1 parent
f49598a1e1
commit
d7cf3f5b18
1 file changed
+1
-2
@@ -1182,8 +1182,7 @@ b4_dollar_popdef])[]dnl
|
||||
size_t lac_size = yylac_stack_.size ();
|
||||
if (yylen < lac_size)
|
||||
{
|
||||
for (size_t i = 0; i < yylen; ++i)
|
||||
yylac_stack_.pop_back ();
|
||||
yylac_stack_.resize (lac_size - yylen);
|
||||
yylen = 0;
|
||||
}
|
||||
else if (lac_size)
|
||||
|
||||
Reference in new issue
Block a user