amazon-ion / ion-element-kotlin

IonElement is an immutable in-memory representation of the Ion data format. IonElement's API is idiomatic to Kotlin.
Apache License 2.0
8 stars 8 forks source link

Consider caching the hashcode for `ListElementImpl` and `SexpElementImpl` #90

Open popematt opened 5 months ago

popematt commented 5 months ago

Hash codes can be a quick way to check in an equals() implementation to see whether a deep comparison is required. We already cache the hashcode for StructElementImpl. Why not do it for ListElementImpl and SexpElementImpl?