From 9ea6341d4610ab95e0d162a9ce4d84f1ce09b8e6 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Fri, 22 Apr 2016 12:20:23 +0300 Subject: [PATCH] Minor --- .../loopToCallChain/sequence/FlatMapTransformation.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/loopToCallChain/sequence/FlatMapTransformation.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/loopToCallChain/sequence/FlatMapTransformation.kt index 532bff08eb3..9fd16b340b0 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/loopToCallChain/sequence/FlatMapTransformation.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/loopToCallChain/sequence/FlatMapTransformation.kt @@ -61,7 +61,7 @@ class FlatMapTransformation( if (iterableType.checkIsSuperTypeOf(nestedSequenceType) == null) return null val nestedLoopBody = nestedLoop.body ?: return null - val newWorkingVariable = nestedLoop.loopParameter ?: return null + val newInputVariable = nestedLoop.loopParameter ?: return null if (state.indexVariable != null && state.indexVariable.hasUsages(transform)) { // if nested loop range uses index, convert to "mapIndexed {...}.flatMap { it }" @@ -71,7 +71,7 @@ class FlatMapTransformation( val newState = state.copy( innerLoop = nestedLoop, statements = listOf(nestedLoopBody), - inputVariable = newWorkingVariable + inputVariable = newInputVariable ) return SequenceTransformationMatch(listOf(mapIndexedTransformation, flatMapTransformation), newState) } @@ -80,7 +80,7 @@ class FlatMapTransformation( val newState = state.copy( innerLoop = nestedLoop, statements = listOf(nestedLoopBody), - inputVariable = newWorkingVariable + inputVariable = newInputVariable ) return SequenceTransformationMatch(transformation, newState) }