You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if o == nil or (type(o) == "table" and not next(o))
not next(o) should be probably replaced with next(o) == nil, because it's valid to store FALSE as table key. If FALSE is returned as first key, the check will treat table as empty. The order of key traversals is undefined, thus types.is_empty can produce random bugs.
Proof:
types.is_empty({ [false] = 777 }) -- true
The text was updated successfully, but these errors were encountered:
not next(o)
should be probably replaced withnext(o) == nil
, because it's valid to store FALSE as table key. If FALSE is returned as first key, the check will treat table as empty. The order of key traversals is undefined, thustypes.is_empty
can produce random bugs.Proof:
types.is_empty({ [false] = 777 }) -- true
The text was updated successfully, but these errors were encountered: