aboutsummaryrefslogtreecommitdiff
path: root/lbuiltin.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-01-19 14:50:30 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-01-19 14:50:30 -0200
commit512b15b6012c14b0b58c4531078d27794a583f84 (patch)
tree57618feea448e8a59975d96234af365072a5661e /lbuiltin.c
parent33d35048892fe745bc5b1f16ff7ff2baf5102c0d (diff)
downloadlua-512b15b6012c14b0b58c4531078d27794a583f84.tar.gz
lua-512b15b6012c14b0b58c4531078d27794a583f84.tar.bz2
lua-512b15b6012c14b0b58c4531078d27794a583f84.zip
small optimizations (relational operators)
Diffstat (limited to 'lbuiltin.c')
-rw-r--r--lbuiltin.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lbuiltin.c b/lbuiltin.c
index 99853e43..260dd8a7 100644
--- a/lbuiltin.c
+++ b/lbuiltin.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbuiltin.c,v 1.90 1999/12/28 19:23:41 roberto Exp roberto $ 2** $Id: lbuiltin.c,v 1.91 1999/12/30 18:27:03 roberto Exp roberto $
3** Built-in functions 3** Built-in functions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -541,10 +541,9 @@ static int sort_comp (lua_State *L, lua_Object f, const TObject *a,
541 luaD_call(L, L->top-3, 1); 541 luaD_call(L, L->top-3, 1);
542 } 542 }
543 else { /* a < b? */ 543 else { /* a < b? */
544 *(L->top) = *a; 544 *(L->top++) = *a;
545 *(L->top+1) = *b; 545 *(L->top++) = *b;
546 luaV_comparison(L, L->top+2, LUA_T_NUMBER, LUA_T_NIL, LUA_T_NIL, IM_LT); 546 luaV_comparison(L);
547 L->top++; /* result of comparison */
548 } 547 }
549 return ttype(--(L->top)) != LUA_T_NIL; 548 return ttype(--(L->top)) != LUA_T_NIL;
550} 549}