Skip to content

Proposed rule: don't use hashCode in the item key for Lazy* Composables #374

@yogurtearl

Description

@yogurtearl

Proposed rule: don't use hashCode in the item key for Lazy* Composables

Item key should be unique.

.hashCode() is not unique.

e.g. these all have the same hash code, even on JS, WASM, etc, same hashcode is unlikely, but not impossible in the wild.

println("aaaa".hashCode())
println("aabB".hashCode())
println("aac#".hashCode())
println("bBaa".hashCode())
println("bBbB".hashCode())
println("c#aa".hashCode())
println("c#bB".hashCode())
println("c#c#".hashCode())

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions