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:
Akim Demaille
2019-08-18 06:54:56 -05:00
parent f49598a1e1
commit d7cf3f5b18

View File

@@ -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)