Minor. Use property instead of deprecated function in Operations map

This commit is contained in:
Denis Zharkov
2015-10-19 11:41:05 +03:00
parent 8db206e7ff
commit 8c62e80d2b
2 changed files with 2 additions and 2 deletions
@@ -98,7 +98,7 @@ internal val unaryOperations: HashMap<UnaryOperationKey<*>, Pair<Function1<Any?,
unaryOperation(SHORT, "unaryMinus", { a -> a.unaryMinus() }, { a -> a.unaryMinus() }),
unaryOperation(SHORT, "unaryPlus", { a -> a.unaryPlus() }, emptyUnaryFun),
unaryOperation(SHORT, "toString", { a -> a.toString() }, emptyUnaryFun),
unaryOperation(STRING, "length", { a -> a.length() }, emptyUnaryFun),
unaryOperation(STRING, "length", { a -> a.length }, emptyUnaryFun),
unaryOperation(STRING, "toString", { a -> a.toString() }, emptyUnaryFun)
)
@@ -81,7 +81,7 @@ fun generate(): String {
val unaryOperationsMapIterator = unaryOperationsMap.iterator()
while (unaryOperationsMapIterator.hasNext()) {
val (funcName, parameters, isFunction) = unaryOperationsMapIterator.next()
val parenthesesOrBlank = "()" //if (isFunction) "()" else ""
val parenthesesOrBlank = if (isFunction) "()" else ""
p.println(
"unaryOperation(",
parameters.map { it.asString() }.joinToString(", "),