use a table to find (and reuse) constants when parsing

This commit is contained in:
Roberto Ierusalimschy
2001-08-27 12:16:28 -03:00
parent 7afc74ff07
commit c3d72096c4
6 changed files with 32 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstring.c,v 1.64 2001/06/07 15:01:21 roberto Exp roberto $
** $Id: lstring.c,v 1.65 2001/06/15 20:36:57 roberto Exp roberto $
** String table (keeps all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ -54,7 +54,6 @@ static TString *newlstr (lua_State *L, const l_char *str, size_t l, lu_hash h) {
ts->tsv.len = l;
ts->tsv.hash = h;
ts->tsv.marked = 0;
ts->tsv.constindex = 0;
memcpy(getstr(ts), str, l*sizeof(l_char));
getstr(ts)[l] = l_c('\0'); /* ending 0 */
tb = &G(L)->strt;