if I rewrite this ```fun findWindowSettings(name:...
# getting-started
e
if I rewrite this
Copy code
fun findWindowSettings(name:String): IniData? {
    val id = hash(name, 0)
    return g.settings.firstOrNull { it.id == id }
}
as
fun findWindowSettings(name:String) = g.settings.firstOrNull { it.id == hash(name, 0) }
will be the
hash()
result cached or executed each time?
m
elect: It will be executed each time.
e
then I'll leave as it is, thanks
c
@elect Also, I might be missing some context on your code but basing equality on hashing is dangerous since two different objects can have the same hash
e
thanks for the tip
however I am just porting imgui to kotlin
that's how he is doing