Skip to content

Set data structure - Something to consider to save memory #1

Description

@finnbear

set: map[interface{}]bool{},

You should consider using an empty struct (struct{}) instead of a boolean (bool) as the map value because it won't occupy any memory. You don't actually use the value of the boolean because you check the ok return value from the map access to see if the key is in the set.

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