lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello All,

It looks like there  is something I am missing or not able to understand ...

If n is Lua_Number, and k is just a cast of n LUA_Number to int, and cast_num just cast k back to LUA_Number, then the the if statement is redundant because they (n , k) would also be same. Could someone help figure out what I am missing ?  Function name const TValue *luaH_get, 
    case LUA_TNUMBER: {
      int k;
      lua_Number n = nvalue(key);
      lua_number2int(k, n);
      if (luai_numeq(cast_num(k), n)) /* index is int? */
        return luaH_getint(t, k);  /* use specialized version */
      /* else go through */
    }
Emeka
--
P.S Please join our groups:  nigeriaarduinogroup@googlegroups.com
 or jifunze-kufikiria@googlegroups.com  These are platforms for learning and sharing  of knowledge.                                                                                      www.satajanus.com | Satajanus  Nig. Ltd