Cannot transform to flatMap if old working variable used in the nested loop

This commit is contained in:
Valentin Kipyatkov
2016-04-05 20:46:42 +03:00
parent 50bd766992
commit d7762778a2
2 changed files with 14 additions and 2 deletions
@@ -0,0 +1,10 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
fun foo(list: List<String>): String? {
<caret>for (s in list) {
for (line in s.lines()) {
if (line.isNotBlank() && line.length < s.length / 10) return line
}
}
return null
}