aboutsummaryrefslogtreecommitdiff
path: root/lobject.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-07-03 11:54:58 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-07-03 11:54:58 -0300
commitae809e9fd132ab867741a6a777450f9bc0d49be4 (patch)
tree402821af72bbf8ee5a5779b48ba978cb6f578416 /lobject.c
parente96385adede47a1abf160a41565ec742d3d4e413 (diff)
downloadlua-ae809e9fd132ab867741a6a777450f9bc0d49be4.tar.gz
lua-ae809e9fd132ab867741a6a777450f9bc0d49be4.tar.bz2
lua-ae809e9fd132ab867741a6a777450f9bc0d49be4.zip
'luaV_concat' can "concat" one single value
Several of its callers needed that case and had to do the check themselves.
Diffstat (limited to 'lobject.c')
-rw-r--r--lobject.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lobject.c b/lobject.c
index 2a28ebd4..223bbd0c 100644
--- a/lobject.c
+++ b/lobject.c
@@ -402,10 +402,8 @@ static void pushstr (BuffFS *buff, const char *str, size_t l) {
402 setsvalue2s(L, L->top, luaS_newlstr(L, str, l)); 402 setsvalue2s(L, L->top, luaS_newlstr(L, str, l));
403 L->top++; /* may use one extra slot */ 403 L->top++; /* may use one extra slot */
404 buff->pushed++; 404 buff->pushed++;
405 if (buff->pushed > 1) { 405 luaV_concat(L, buff->pushed); /* join partial results into one */
406 luaV_concat(L, buff->pushed); /* join partial results into one */ 406 buff->pushed = 1;
407 buff->pushed = 1;
408 }
409} 407}
410 408
411 409