Skip to content

Use System.identityHashCode in Attribute#hashCode #5

@norswap

Description

@norswap
  • Attribute#equals uses object identity to compares its fields, so its unecessary (and in fact, potentially counter-productive) to compute the full hashCode of its fields in the hashCode method.
  • A student stumbled upon an issue where the hashCode of the Attribute changed because he made a change to the underyling AST. While this is not strictly a bug (AST should be immutable), it would have been avoided by using identityHashCode.
  • This will improve performance a lot: the current implem of SighNode#hashCode uses reflection and is very inefficient.

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