Garry's Mod Wiki

Revision Difference

table.IsEmpty#549709

<function name="IsEmpty" parent="table" type="libraryfunc"> <description> Returns whether or not the given table is empty. This works on both sequential and non-sequential tables, and is a lot faster to use than `table.Count(tbl) == 0`. For checking if a table is not empty, try using `next(tbl) ~= nil`. If you want to check if a table is not empty, use `next(tbl) ~= nil`, as it is slightly faster. </description> <realm>Shared and Menu</realm> <file line="55-L61">lua/includes/extensions/table.lua</file> <args> <arg name="tab" type="table">Table to check.</arg> </args> <rets> <ret name="" type="boolean">Is empty?</ret> </rets> </function>