diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-03-03 15:17:04 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-03-03 15:17:04 -0300 |
commit | 29aed2880229fa9b9a0284db8a0bd4db76375f7e (patch) | |
tree | 025ae7322b58139a97fe59cb6a1efe58b7157013 /llex.c | |
parent | 951b562cf847a1ed660ac7f682a197b6b8f5967b (diff) | |
download | lua-29aed2880229fa9b9a0284db8a0bd4db76375f7e.tar.gz lua-29aed2880229fa9b9a0284db8a0bd4db76375f7e.tar.bz2 lua-29aed2880229fa9b9a0284db8a0bd4db76375f7e.zip |
detail (use 'luaS_newliteral' when possible)
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.88 2014/11/02 19:19:04 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.89 2014/11/14 16:06:09 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -68,7 +68,7 @@ static void save (LexState *ls, int c) { | |||
68 | 68 | ||
69 | void luaX_init (lua_State *L) { | 69 | void luaX_init (lua_State *L) { |
70 | int i; | 70 | int i; |
71 | TString *e = luaS_new(L, LUA_ENV); /* create env name */ | 71 | TString *e = luaS_newliteral(L, LUA_ENV); /* create env name */ |
72 | luaC_fix(L, obj2gco(e)); /* never collect this name */ | 72 | luaC_fix(L, obj2gco(e)); /* never collect this name */ |
73 | for (i=0; i<NUM_RESERVED; i++) { | 73 | for (i=0; i<NUM_RESERVED; i++) { |
74 | TString *ts = luaS_new(L, luaX_tokens[i]); | 74 | TString *ts = luaS_new(L, luaX_tokens[i]); |
@@ -172,7 +172,7 @@ void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, | |||
172 | ls->linenumber = 1; | 172 | ls->linenumber = 1; |
173 | ls->lastline = 1; | 173 | ls->lastline = 1; |
174 | ls->source = source; | 174 | ls->source = source; |
175 | ls->envn = luaS_new(L, LUA_ENV); /* get env name */ | 175 | ls->envn = luaS_newliteral(L, LUA_ENV); /* get env name */ |
176 | luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ | 176 | luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ |
177 | } | 177 | } |
178 | 178 | ||