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))
|
||||
}
|
||||
else if (arg.startsWith('-')) {
|
||||
val translation = optionDictionary[arg]
|
||||
if (translation != null)
|
||||
options.add(translation.substring(startIndex=2))
|
||||
if (optionDictionary.containsKey(arg))
|
||||
options.add(optionDictionary[arg]!!.substring(startIndex=2))
|
||||
else
|
||||
System.err.println("Short-hand '$arg' does not exist. Ignoring!")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue