Closed GoogleCodeExporter closed 8 years ago
A possibility to lazily evaluate the defaultValue parameter (or pass a closure)
would be a plus
Original comment by gromop...@gmail.com
on 11 Mar 2011 at 10:44
Original comment by alex.tka...@gmail.com
on 11 Mar 2011 at 10:50
Original comment by alex.tka...@gmail.com
on 11 Mar 2011 at 10:55
I guess the next thing you will ask will be putIfAbsent with lazy evaluation
Original comment by alex.tka...@gmail.com
on 11 Mar 2011 at 10:56
It will be like this
final V get(K key, V defaultValue) { getAt(0, key, key.hashCode()) ?: defaultValue }
final V getOr(K key, Callable<V> defaultValue) { getAt(0, key, key.hashCode()) ?: defaultValue() }
Original comment by alex.tka...@gmail.com
on 11 Mar 2011 at 11:22
Original comment by alex.tka...@gmail.com
on 11 Mar 2011 at 11:24
Original issue reported on code.google.com by
gromop...@gmail.com
on 11 Mar 2011 at 10:35