Cleanup (optimization; formatting)

This commit is contained in:
Roman Shevchenko
2014-06-04 21:29:15 +04:00
parent 5d85b2bd3c
commit f52fccdb91
2 changed files with 10 additions and 10 deletions
@@ -80,14 +80,14 @@ public class PsiImplUtil {
@NotNull
public static PsiMethod[] getConstructors(@NotNull PsiClass aClass) {
final List<PsiMethod> constructorsList = new SmartList<PsiMethod>();
final PsiMethod[] methods = aClass.getMethods();
for (final PsiMethod method : methods) {
if (method.isConstructor()) constructorsList.add(method);
List<PsiMethod> result = null;
for (PsiMethod method : aClass.getMethods()) {
if (method.isConstructor()) {
if (result == null) result = ContainerUtil.newSmartList();
result.add(method);
}
}
return constructorsList.toArray(new PsiMethod[constructorsList.size()]);
return result == null ? PsiMethod.EMPTY_ARRAY : result.toArray(new PsiMethod[result.size()]);
}
@Nullable
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -448,8 +448,8 @@ public class ClsClassImpl extends ClsMemberImpl<PsiClassStub<?>> implements PsiE
@NotNull ResolveState state,
PsiElement lastParent,
@NotNull PsiElement place) {
LanguageLevel languageLevel = processor instanceof MethodsProcessor ? ((MethodsProcessor)processor).getLanguageLevel() : PsiUtil.getLanguageLevel(place);
return PsiClassImplUtil.processDeclarationsInClass(this, processor, state, null, lastParent, place, languageLevel, false);
LanguageLevel level = processor instanceof MethodsProcessor ? ((MethodsProcessor)processor).getLanguageLevel() : PsiUtil.getLanguageLevel(place);
return PsiClassImplUtil.processDeclarationsInClass(this, processor, state, null, lastParent, place, level, false);
}
@Override