More simple code doing the same

This commit is contained in:
Valentin Kipyatkov
2015-04-08 16:40:07 +03:00
parent f6e363abb8
commit fe14107848
@@ -270,10 +270,9 @@ public class KotlinCopyPasteReferenceProcessor() : CopyPastePostProcessor<Kotlin
.filterNot { ErrorUtils.isError(it) } .filterNot { ErrorUtils.isError(it) }
.map { it.importableFqName } .map { it.importableFqName }
.filterNotNull() .filterNotNull()
.toSet()
val originalFqName = FqName(refData.fqName) val originalFqName = FqName(refData.fqName)
val referencesSame = referencedFqNames.any { it == originalFqName } if (referencedFqNames.singleOrNull() == originalFqName) return null
val conflict = referencedFqNames.any { it != originalFqName }
if (referencesSame && !conflict) return null
return ReferenceToRestoreData(reference, refData) return ReferenceToRestoreData(reference, refData)
} }