Avoid unnecessary temporary variable in short-hand translation
This commit is contained in:
parent
a48f122296
commit
4ab78f4028
1 changed files with 2 additions and 3 deletions
|
@ -23,9 +23,8 @@ fun main(args: Array<String>) {
|
||||||
options.add(arg.substring(startIndex=2))
|
options.add(arg.substring(startIndex=2))
|
||||||
}
|
}
|
||||||
else if (arg.startsWith('-')) {
|
else if (arg.startsWith('-')) {
|
||||||
val translation = optionDictionary[arg]
|
if (optionDictionary.containsKey(arg))
|
||||||
if (translation != null)
|
options.add(optionDictionary[arg]!!.substring(startIndex=2))
|
||||||
options.add(translation.substring(startIndex=2))
|
|
||||||
else
|
else
|
||||||
System.err.println("Short-hand '$arg' does not exist. Ignoring!")
|
System.err.println("Short-hand '$arg' does not exist. Ignoring!")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue