diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-08-27 12:16:28 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-08-27 12:16:28 -0300 |
| commit | c3d72096c4841ebc04a0615917d71f22aaa5e5ff (patch) | |
| tree | 45b143ed4284ba9b30fdae965aef0a047aab6deb /lstring.c | |
| parent | 7afc74ff07907294a2162600023a9c61a64cdbd5 (diff) | |
| download | lua-c3d72096c4841ebc04a0615917d71f22aaa5e5ff.tar.gz lua-c3d72096c4841ebc04a0615917d71f22aaa5e5ff.tar.bz2 lua-c3d72096c4841ebc04a0615917d71f22aaa5e5ff.zip | |
use a table to find (and reuse) constants when parsing
Diffstat (limited to 'lstring.c')
| -rw-r--r-- | lstring.c | 3 |
1 files changed, 1 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstring.c,v 1.64 2001/06/07 15:01:21 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 1.65 2001/06/15 20:36:57 roberto Exp roberto $ |
| 3 | ** String table (keeps all strings handled by Lua) | 3 | ** String table (keeps all strings handled by Lua) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -54,7 +54,6 @@ static TString *newlstr (lua_State *L, const l_char *str, size_t l, lu_hash h) { | |||
| 54 | ts->tsv.len = l; | 54 | ts->tsv.len = l; |
| 55 | ts->tsv.hash = h; | 55 | ts->tsv.hash = h; |
| 56 | ts->tsv.marked = 0; | 56 | ts->tsv.marked = 0; |
| 57 | ts->tsv.constindex = 0; | ||
| 58 | memcpy(getstr(ts), str, l*sizeof(l_char)); | 57 | memcpy(getstr(ts), str, l*sizeof(l_char)); |
| 59 | getstr(ts)[l] = l_c('\0'); /* ending 0 */ | 58 | getstr(ts)[l] = l_c('\0'); /* ending 0 */ |
| 60 | tb = &G(L)->strt; | 59 | tb = &G(L)->strt; |
