mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Don't create unnecessary objects.
This commit is contained in:
parent
f126984c7a
commit
4bef03dc3e
1 changed files with 3 additions and 4 deletions
|
@ -75,9 +75,9 @@ public class SemanticUtil {
|
||||||
* @return an array of conversion operators.
|
* @return an array of conversion operators.
|
||||||
*/
|
*/
|
||||||
public static final ICPPMethod[] getDeclaredConversionOperators(ICPPClassType clazz) throws DOMException {
|
public static final ICPPMethod[] getDeclaredConversionOperators(ICPPClassType clazz) throws DOMException {
|
||||||
ICPPMethod[] methods= new ICPPMethod[0];
|
ICPPMethod[] methods= ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
||||||
if (clazz instanceof ICPPDeferredClassInstance) {
|
if (clazz instanceof ICPPDeferredClassInstance) {
|
||||||
clazz= (ICPPClassType) ((ICPPDeferredClassInstance)clazz).getTemplateDefinition();
|
clazz= (ICPPClassType) ((ICPPDeferredClassInstance) clazz).getTemplateDefinition();
|
||||||
}
|
}
|
||||||
ICPPMethod[] decs= clazz.getDeclaredMethods();
|
ICPPMethod[] decs= clazz.getDeclaredMethods();
|
||||||
if (decs != null) {
|
if (decs != null) {
|
||||||
|
@ -98,7 +98,7 @@ public class SemanticUtil {
|
||||||
* @return an array of conversion operators.
|
* @return an array of conversion operators.
|
||||||
*/
|
*/
|
||||||
public static ICPPMethod[] getConversionOperators(ICPPClassType clazz) throws DOMException {
|
public static ICPPMethod[] getConversionOperators(ICPPClassType clazz) throws DOMException {
|
||||||
ICPPMethod[] methods= new ICPPMethod[0];
|
ICPPMethod[] methods= ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
||||||
ObjectSet<ICPPClassType> ancestry= inheritanceClosure(clazz);
|
ObjectSet<ICPPClassType> ancestry= inheritanceClosure(clazz);
|
||||||
for (int i = 0; i < ancestry.size(); i++) {
|
for (int i = 0; i < ancestry.size(); i++) {
|
||||||
methods= (ICPPMethod[]) ArrayUtil.addAll(ICPPMethod.class, methods, getDeclaredConversionOperators(ancestry.keyAt(i)));
|
methods= (ICPPMethod[]) ArrayUtil.addAll(ICPPMethod.class, methods, getDeclaredConversionOperators(ancestry.keyAt(i)));
|
||||||
|
@ -403,5 +403,4 @@ public class SemanticUtil {
|
||||||
}
|
}
|
||||||
return baseType;
|
return baseType;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue