avoid using 'ttype' when there is an explicit test

This commit is contained in:
Roberto Ierusalimschy 2009-11-06 15:05:34 -02:00
parent 599789a907
commit 155dd01163

7
lvm.h
View File

@ -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))