mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
Do not compute file imports and package in loop
This commit is contained in:
+4
-4
@@ -196,7 +196,10 @@ class OverrideSuperclassMethodsAction : BaseCodeAction() {
|
||||
val classTree = typeFinder.scan(task.root(), position)
|
||||
val thisClass = trees.getElement(typeFinder.path) as TypeElement
|
||||
val indent = EditHelper.indent(task.task, task.root(), classTree) + 4
|
||||
|
||||
val fileImports =
|
||||
task.root(file).imports.map { it.qualifiedIdentifier.toString() }.toSet()
|
||||
val filePackage = task.root(file).`package`.packageName.toString()
|
||||
|
||||
for (pointer in checkedMethods) {
|
||||
val superMethod =
|
||||
FindHelper.findMethod(
|
||||
@@ -211,9 +214,6 @@ class OverrideSuperclassMethodsAction : BaseCodeAction() {
|
||||
sb.replace(Regex(Regex.escape("\n")), "\n${EditHelper.repeatSpaces(indent)}")
|
||||
sb.append("\n")
|
||||
|
||||
val fileImports =
|
||||
task.root(file).imports.map { it.qualifiedIdentifier.toString() }.toSet()
|
||||
val filePackage = task.root(file).`package`.packageName.toString()
|
||||
newImports.removeIf {
|
||||
it.startsWith("java.lang.") ||
|
||||
it.startsWith(filePackage) ||
|
||||
|
||||
Reference in New Issue
Block a user