aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-02-18 13:02:56 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-02-18 13:02:56 -0300
commit60c83ded3080a23bc661ab440c36d0a71b399e2e (patch)
tree0aa24b14c1215541b52e7885fd2f2c41aa128a06 /lparser.c
parent07948c3181702c55b7b36069ca519b54371a4ab7 (diff)
downloadlua-60c83ded3080a23bc661ab440c36d0a71b399e2e.tar.gz
lua-60c83ded3080a23bc661ab440c36d0a71b399e2e.tar.bz2
lua-60c83ded3080a23bc661ab440c36d0a71b399e2e.zip
small optimization for sizes of array constructors
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lparser.c b/lparser.c
index 68373d54..c5b5df85 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.204 2003/02/11 10:46:24 roberto Exp roberto $ 2** $Id: lparser.c,v 1.205 2003/02/11 10:49:53 roberto Exp roberto $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -515,8 +515,7 @@ static void constructor (LexState *ls, expdesc *t) {
515 } while (testnext(ls, ',') || testnext(ls, ';')); 515 } while (testnext(ls, ',') || testnext(ls, ';'));
516 check_match(ls, '}', '{', line); 516 check_match(ls, '}', '{', line);
517 lastlistfield(fs, &cc); 517 lastlistfield(fs, &cc);
518 if (cc.na > 0) 518 SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */
519 SETARG_B(fs->f->code[pc], luaO_log2(cc.na-1)+2); /* set initial table size */
520 SETARG_C(fs->f->code[pc], luaO_log2(cc.nh)+1); /* set initial table size */ 519 SETARG_C(fs->f->code[pc], luaO_log2(cc.nh)+1); /* set initial table size */
521} 520}
522 521