Skip to content

Don't use 0 as the hash of false #8

@no-longer-on-githu-b

Description

@no-longer-on-githu-b

The combining function is a * 31 + b, so combining with zero doesn't do anything to the hash. This means that the arrays [false, false, false, true], [false, false, true], [false, true] and [true] all have the same hash.

The solution would be not to use zero as the hash of false. Similar for Nothing.

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