Minor
This commit is contained in:
+15
-18
@@ -330,29 +330,26 @@ object FindTransformationMatcher : TransformationMatcher {
|
|||||||
filter: KtExpression?,
|
filter: KtExpression?,
|
||||||
negated: Boolean
|
negated: Boolean
|
||||||
): FindOperationGenerator {
|
): FindOperationGenerator {
|
||||||
if (filter != null) {
|
if (filter == null) {
|
||||||
val containsArgument = filter.isFilterForContainsOperation(inputVariable, loop)
|
return SimpleGenerator(if (negated) "none" else "any", inputVariable, filter)
|
||||||
if (containsArgument != null) {
|
}
|
||||||
val generator = SimpleGenerator("contains", inputVariable, null, containsArgument)
|
|
||||||
if (negated) {
|
val containsArgument = filter.isFilterForContainsOperation(inputVariable, loop)
|
||||||
return object : FindOperationGenerator(generator) {
|
if (containsArgument != null) {
|
||||||
override fun generate(chainedCallGenerator: ChainedCallGenerator): KtExpression {
|
val generator = SimpleGenerator("contains", inputVariable, null, containsArgument)
|
||||||
return generator.generate(chainedCallGenerator).negate()
|
if (negated) {
|
||||||
}
|
return object : FindOperationGenerator(generator) {
|
||||||
|
override fun generate(chainedCallGenerator: ChainedCallGenerator): KtExpression {
|
||||||
|
return generator.generate(chainedCallGenerator).negate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
return generator
|
else {
|
||||||
}
|
return generator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (negated) {
|
return SimpleGenerator(if (negated) "none" else "any", inputVariable, filter)
|
||||||
return SimpleGenerator("none", inputVariable, filter)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return SimpleGenerator("any", inputVariable, filter)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun KtExpression.isFilterForContainsOperation(inputVariable: KtCallableDeclaration, loop: KtForExpression): KtExpression? {
|
private fun KtExpression.isFilterForContainsOperation(inputVariable: KtCallableDeclaration, loop: KtForExpression): KtExpression? {
|
||||||
|
|||||||
Reference in New Issue
Block a user