Browse Source

avoid using 'ttype' when there is an explicit test

Roberto Ierusalimschy 15 years ago
parent
commit
155dd01163
1 changed files with 3 additions and 4 deletions
  1. 3 4
      lvm.h

+ 3 - 4
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))