2013年3月14日

lua里 table的长度#table 的计算方法

摘要: int luaH_getn (Table *t) { unsigned int j = t->sizearray; if (j > 0 && ttisnil(&t->array[j - 1])) { /* there is a boundary in the array part: (binary) search for it */ unsigned int i = 0; while (j - i > 1) { unsigned int m = (i+j)/2; if (ttisnil(&t->array[m - 1])) j = 阅读全文

posted @ 2013-03-14 16:36 快乐的大猪 阅读(460) 评论(0) 推荐(0) 编辑

lua中 只有 nil 和 false 为假, 其他都为真包括0

摘要: lua中 只有 nil 和 false 为假, 其他都为真包括0 阅读全文

posted @ 2013-03-14 14:14 快乐的大猪 阅读(944) 评论(0) 推荐(0) 编辑

导航