Remove minor optimization in CodeConformanceTest

This commit is contained in:
Nikolay Krasko
2020-08-17 18:55:50 +03:00
parent 01f3bdfc69
commit c30910130e
@@ -260,12 +260,11 @@ class CodeConformanceTest : TestCase() {
private class FileMatcher(val root: File, paths: Collection<String>) {
private val files = paths.map { File(it) }
private val names = files.mapTo(HashSet()) { it.name }
private val paths = files.mapTo(HashSet()) { it.systemIndependentPath }
private val relativePaths = files.filterTo(ArrayList()) { it.isDirectory }.mapTo(HashSet()) { it.systemIndependentPath + "/" }
fun matchExact(file: File): Boolean {
return (file.name in names) && file.relativeTo(root).systemIndependentPath in paths
return file.relativeTo(root).systemIndependentPath in paths
}
fun matchWithContains(file: File): Boolean {