Use computeIsAbsent instead of getOrPut in generated expression

This commit is contained in:
Vitaliy.Bibaev
2017-12-21 11:25:15 +03:00
committed by Yan Zhulanow
parent fd17d9959a
commit 113bb9ca46
@@ -22,7 +22,7 @@ class KotlinMapVariable(type: MapType, name: String) : MapVariableBase(type, nam
override fun keys(): Expression = TextExpression("${toCode()}.keys")
override fun computeIfAbsent(key: Expression, supplier: Lambda): Expression =
TextExpression("${toCode()}.getOrPut(${key.toCode()}, ${supplier.toCode()})")
TextExpression("${toCode()}.computeIfAbsent(${key.toCode()}, ${supplier.toCode()})")
override fun defaultDeclaration(isMutable: Boolean): VariableDeclaration =
KotlinVariableDeclaration(this, false, type.defaultValue)