Skip to content

Commit bf90656

Browse files
committed
improve table.empty
1 parent 7dabd19 commit bf90656

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xmake/core/base/table.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ end
533533

534534
-- is empty table?
535535
function table.empty(tbl)
536-
return type(tbl) == "table" and #tbl == 0 and #table.keys(tbl) == 0
536+
return type(tbl) == "table" and next(tbl) == nil
537537
end
538538

539539
-- return indices or keys for the given value

0 commit comments

Comments
 (0)