'luaV_concat' can "concat" one single value

Several of its callers needed that case and had to do the check
themselves.
This commit is contained in:
Roberto Ierusalimschy
2020-07-03 11:54:58 -03:00
parent e96385aded
commit ae809e9fd1
3 changed files with 9 additions and 14 deletions

View File

@@ -402,10 +402,8 @@ static void pushstr (BuffFS *buff, const char *str, size_t l) {
setsvalue2s(L, L->top, luaS_newlstr(L, str, l));
L->top++; /* may use one extra slot */
buff->pushed++;
if (buff->pushed > 1) {
luaV_concat(L, buff->pushed); /* join partial results into one */
buff->pushed = 1;
}
luaV_concat(L, buff->pushed); /* join partial results into one */
buff->pushed = 1;
}