mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-13 14:50:43 +08:00
Improve performance
This commit is contained in:
parent
e299ecffb9
commit
e4f37b9a52
@ -92,17 +92,15 @@ class PluginDescriptionChecker : DeclarationChecker {
|
|||||||
call.valueParametersWithArguments().asSequence()
|
call.valueParametersWithArguments().asSequence()
|
||||||
}
|
}
|
||||||
.mapNotNull { (p, a) ->
|
.mapNotNull { (p, a) ->
|
||||||
p.resolveContextKind?.takeIf { it in checkersMap }?.let { it to a }
|
p.resolveContextKind?.let(checkersMap::get)?.let { it to a }
|
||||||
}
|
}
|
||||||
.mapNotNull { (kind, argument) ->
|
.mapNotNull { (kind, argument) ->
|
||||||
argument.resolveStringConstantValue(context.bindingContext)?.let { const ->
|
argument.resolveStringConstantValue(context.bindingContext)?.let { const ->
|
||||||
Triple(kind, argument, const)
|
Triple(kind, argument, const)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.forEach { (parameterContextKind, argument, resolvedConstant) ->
|
.forEach { (fn, argument, resolvedConstant) ->
|
||||||
for ((kind, fn) in checkersMap) {
|
fn(argument.asElement(), resolvedConstant)?.let { context.report(it) }
|
||||||
if (parameterContextKind == kind) fn(argument.asElement(), resolvedConstant)?.let { context.report(it) }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user