mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[java-psi] filterAnnotations: avoid Streams
Usually the resulting list is 0-1 element but queried kinda often, so stream overhead is visible GitOrigin-RevId: 06f9932a35b1cfbe4c9a619de986e0c54f8c0c52
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dde51de143
commit
f93ad46282
@@ -105,10 +105,14 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
|
||||
|
||||
@NotNull
|
||||
private List<PsiAnnotation> filterAnnotations(@NotNull List<AnnotationData> result, @NotNull String annotationFQN) {
|
||||
return StreamEx.of(result)
|
||||
.filter(data -> data.annotationClassFqName.equals(annotationFQN))
|
||||
.map(data -> data.getAnnotation(this))
|
||||
.toCollection(SmartList::new);
|
||||
SmartList<PsiAnnotation> annotations = new SmartList<>();
|
||||
for (AnnotationData data : result) {
|
||||
if (data.annotationClassFqName.equals(annotationFQN)) {
|
||||
PsiAnnotation annotation = data.getAnnotation(this);
|
||||
annotations.add(annotation);
|
||||
}
|
||||
}
|
||||
return annotations;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user