On Mon, 17 Apr 2023 13:27:43 GMT, olivergillespie <d...@openjdk.org> wrote:

> > Why isn't `Enum::hashCode` simply doing `return ordinal;`?
> 
> See https://bugs.openjdk.org/browse/JDK-8050217

Thanks! If there are apps where `Enum::hashCode` is performance sensitive then 
run-to-run stability may be a stronger argument than @stuart-marks et al argues 
it is here, though there might be some unspoken arguments about how it might 
affect iteration order et.c... 

Adding a cached field to `Enum` seem innocuous though, whether it disappears 
into a padding gap or not.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13491#issuecomment-1511370298

Reply via email to