diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-03 11:54:58 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-03 11:54:58 -0300 |
commit | ae809e9fd132ab867741a6a777450f9bc0d49be4 (patch) | |
tree | 402821af72bbf8ee5a5779b48ba978cb6f578416 /lobject.c | |
parent | e96385adede47a1abf160a41565ec742d3d4e413 (diff) | |
download | lua-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.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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 | ||