From 4d4e6f07c022f94999c52fb593a20fce85c5092a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 22 Feb 2000 16:12:46 -0200 Subject: all order operators use a single tag method (<) --- lbuiltin.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lbuiltin.c') diff --git a/lbuiltin.c b/lbuiltin.c index 260dd8a7..7e0c832c 100644 --- a/lbuiltin.c +++ b/lbuiltin.c @@ -1,5 +1,5 @@ /* -** $Id: lbuiltin.c,v 1.91 1999/12/30 18:27:03 roberto Exp roberto $ +** $Id: lbuiltin.c,v 1.92 2000/01/19 16:50:30 roberto Exp roberto $ ** Built-in functions ** See Copyright Notice in lua.h */ @@ -539,13 +539,16 @@ static int sort_comp (lua_State *L, lua_Object f, const TObject *a, *(L->top+2) = *b; L->top += 3; luaD_call(L, L->top-3, 1); + L->top--; + return (ttype(L->top) != LUA_T_NIL); } else { /* a < b? */ - *(L->top++) = *a; - *(L->top++) = *b; - luaV_comparison(L); + int res; + *(L->top) = *a; + *(L->top+1) = *b; + res = luaV_lessthan(L, L->top, L->top+1); + return res; } - return ttype(--(L->top)) != LUA_T_NIL; } static void auxsort (lua_State *L, Hash *a, int l, int u, lua_Object f) { -- cgit v1.2.3-55-g6feb