[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lvm.c query
- From: Gavin Wraith <gavin@...>
- Date: Sun, 20 Aug 2006 14:45:15 +0100
In lvm.c,v 2.61 2006/01/10 12:50:00, in
void luaV_gettable (lua_State *L, const TValue *t,
TValue *key, StkId val) {
int loop;
for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm;
if (ttistable(t)) { /* `t' is a table? */
Table *h = hvalue(t);
........... [ snip ] ........
would it not be more efficient to lift the evaluation
of ttistable(t) out of the loop?
int loop, is_a_table;
is_a_table = ttistable(t);
for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm;
if (is_a_table) { /* `t' is a table? */
........... [ snip ] ........
Or have I missed something?
--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/