felangel / equatable

A Dart package that helps to implement value based equality without needing to explicitly override == and hashCode.
https://pub.dev/packages/equatable
MIT License
901 stars 100 forks source link

Store hashCode #152

Closed MelbourneDeveloper closed 1 year ago

MelbourneDeveloper commented 1 year ago

Status

READY

Breaking Changes

YES

I will break implementations that use mutable types.

Description

Performance enhancement for hashCode. More documentation on the original issue.

MelbourneDeveloper commented 1 year ago

@felangel yep, understandable. And, there is no real way to precalculate the hashCode in the constructor of the Equatable class without removing const

image

Still, there is something about recalculating hashes on an immutable type that is unsatisfying