From a51fe9a9b00d76d47ee9f5fdf76b223aa7bcf414 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Wed, 27 Apr 2016 14:56:46 +0300 Subject: [PATCH] Minor change on code review --- .../kotlin/idea/completion/LookupElementsCollector.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/LookupElementsCollector.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/LookupElementsCollector.kt index 8c4a99c23d9..7437957ce81 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/LookupElementsCollector.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/LookupElementsCollector.kt @@ -54,11 +54,6 @@ class LookupElementsCollector( resultSet.addAllElements(elements) elements.clear() isResultEmpty = false - - for (element in elements) { - val matchingDegree = RealPrefixMatchingWeigher.getBestMatchingDegree(element, prefixMatcher) - bestMatchingDegree = Math.max(bestMatchingDegree, matchingDegree) - } } } @@ -138,6 +133,9 @@ class LookupElementsCollector( } elements.add(result) + + val matchingDegree = RealPrefixMatchingWeigher.getBestMatchingDegree(result, prefixMatcher) + bestMatchingDegree = Math.max(bestMatchingDegree, matchingDegree) } // used to avoid insertion of spaces before/after ',', '=' on just typing