Skip to content

Only use non-padding bits for ==/hash? #6

Open
@Seelengrab

Description

Currently, == and hash both just use the plain-bits, even if those contain padding bits (which have undefined value). This has the sideeffect of making two objects whose fields are equal unequal if their padding bits differ (which shouldn't matter). There are three possible paths:

  1. Mask out the padding bits, thereby getting a consistent value for comparison
  2. Explicitly iterate over the fields as declared, comparing equality for each
  3. Ignore the issue entirely and try to ensure that padding bits are always a consistent value, sidestepping the problem

1 has the advantage of being likely faster & easier to implement, while 2. is likely more correct, as it doesn't make us observe padding bits. 3. could be difficult to guarantee.

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

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions