Do not sort twice

This commit is contained in:
Ilya Gorbunov
2015-10-06 22:00:01 +03:00
parent 352ac58ba5
commit 17fc1d9562
2 changed files with 2 additions and 3 deletions
@@ -383,14 +383,13 @@ internal class DescriptorRendererImpl(
} ?: emptyList()
val defaultList = parameterDescriptorsWithDefaultValue.filter { !allValueArguments.containsKey(it) }.map {
"${it.getName().asString()} = ..."
}.sorted()
}
val argumentList = allValueArguments.entrySet()
.map { entry ->
val name = entry.key.getName().asString()
val value = if (!parameterDescriptorsWithDefaultValue.contains(entry.key)) renderConstant(entry.value) else "..."
"$name = $value"
}
.sorted()
return (defaultList + argumentList).sorted()
}
@@ -53,7 +53,7 @@ fun getDirectoryString(dir: File, interestingPaths: List<String>): String {
val listFiles = dir.listFiles()
assertNotNull(listFiles)
val children = listFiles!!.toList().sortedBy { it.getName() }.sortedBy { it.isDirectory() }
val children = listFiles!!.sortedWith(compareBy ({ it.directory }, { it.name } ))
for (child in children) {
if (child.isDirectory()) {
p.println(child.name)