diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-08 21:19:22 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-08 21:19:22 -0300 |
commit | 88b306f495fa7034c708c6b75a355a6deee51c58 (patch) | |
tree | 7d8faaacd1f5c753ed9e77f0e2c8e27b9a002635 /lbuiltin.c | |
parent | 563de491be90601f23a735aede89ea9a3ef86ee9 (diff) | |
download | lua-88b306f495fa7034c708c6b75a355a6deee51c58.tar.gz lua-88b306f495fa7034c708c6b75a355a6deee51c58.tar.bz2 lua-88b306f495fa7034c708c6b75a355a6deee51c58.zip |
some optimizations
Diffstat (limited to 'lbuiltin.c')
-rw-r--r-- | lbuiltin.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.93 2000/02/22 18:12:46 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.94 2000/03/03 14:58:26 roberto Exp $ |
3 | ** Built-in functions | 3 | ** Built-in functions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -553,13 +553,8 @@ static int sort_comp (lua_State *L, lua_Object f, const TObject *a, | |||
553 | L->top--; | 553 | L->top--; |
554 | return (ttype(L->top) != LUA_T_NIL); | 554 | return (ttype(L->top) != LUA_T_NIL); |
555 | } | 555 | } |
556 | else { /* a < b? */ | 556 | else /* a < b? */ |
557 | int res; | 557 | return luaV_lessthan(L, a, b, L->top); |
558 | *(L->top) = *a; | ||
559 | *(L->top+1) = *b; | ||
560 | res = luaV_lessthan(L, L->top, L->top+1); | ||
561 | return res; | ||
562 | } | ||
563 | } | 558 | } |
564 | 559 | ||
565 | static void auxsort (lua_State *L, Hash *a, int l, int u, lua_Object f) { | 560 | static void auxsort (lua_State *L, Hash *a, int l, int u, lua_Object f) { |