lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 155dd01163cb67f4ee64d828337b06b7753af295
parent 599789a907fad3bda13a3eaeb41dab3338d4a451
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  6 Nov 2009 15:05:10 -0200

avoid using 'ttype' when there is an explicit test

Diffstat:
Mlvm.h | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lvm.h b/lvm.h @@ -1,5 +1,5 @@ /* -** $Id: lvm.h,v 2.10 2009/06/17 16:17:14 roberto Exp roberto $ +** $Id: lvm.h,v 2.11 2009/06/17 17:51:07 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -13,10 +13,9 @@ #include "ltm.h" -#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) +#define tostring(L,o) (ttisstring(o) || (luaV_tostring(L, o))) -#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ - (((o) = luaV_tonumber(o,n)) != NULL)) +#define tonumber(o,n) (ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL)) #define equalobj(L,o1,o2) \ (ttype(o1) == ttype(o2) && luaV_equalval_(L, o1, o2))