aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-12-15 16:44:22 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-12-15 16:44:22 -0300
commitd70a0c91ad42275af1f6f1b6e37c604442b3f0d1 (patch)
tree1507250574d5f9b34c32a0fade34fbeaecb7c5f9 /lstrlib.c
parent3e6818ca87b8d7aa007e6992295956a92bb89de4 (diff)
downloadlua-d70a0c91ad42275af1f6f1b6e37c604442b3f0d1.tar.gz
lua-d70a0c91ad42275af1f6f1b6e37c604442b3f0d1.tar.bz2
lua-d70a0c91ad42275af1f6f1b6e37c604442b3f0d1.zip
Dump/undump reuse strings
A repeated string in a dump is represented as an index to its first occurence, instead of another copy of the string.
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 0b4fdbb7..ce07d9bc 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -239,6 +239,7 @@ static int str_dump (lua_State *L) {
239 if (l_unlikely(lua_dump(L, writer, &state, strip) != 0)) 239 if (l_unlikely(lua_dump(L, writer, &state, strip) != 0))
240 return luaL_error(L, "unable to dump given function"); 240 return luaL_error(L, "unable to dump given function");
241 luaL_pushresult(&state.B); 241 luaL_pushresult(&state.B);
242 lua_assert(lua_isfunction(L, 1)); /* lua_dump kept that value */
242 return 1; 243 return 1;
243} 244}
244 245