evkaky
08/29/2017, 3:20 PMval map = mutableMapOf(...)
map[someKey] += 1 // error: operator += is not allowed on a nullable receiver :(
but my algrithm assumes that someKey
is 100% presented in my map.
Ok, I’ll try !!
operator (this is one I need in my situation, right?)
map[someKey]!! += 1 // error: variable expected
map[someKey] = map[someKey]!! + 1
It works, but seems a bit verbose. And I know, that verbosity isn’t a kotlin way.
Guys, need your help!