Skip to content

Array mutation #15

Description

@kapcod

#has on Array level removes item from Array, without cloning or something, it creates all sorts of unexpected issues, especially if called #has on Array by mistake.
I suggest only allowing #has on Hash scope (and #item only on Array scope) and if it's not possible, then do some cloning, in order to preserve original array when getting out of current scope.
Another idea is to make #has on Array do array.include?(arg) instead of shift the first item.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions