Skip to content

Commit 10b13fd

Browse files
committed
Optimizations
1 parent ec4bdc0 commit 10b13fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/soot/FastHierarchy.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ private SootMethod resolveMethod(final SootClass baseType, final SootClass decla
904904
// determining the most specific super interface
905905
HashSet<SootClass> interfaceIgnoreList = new HashSet<>();
906906
for (SootClass concreteType = baseType; concreteType != null;) {
907-
Queue<SootClass> worklist = new LinkedList<>(concreteType.getInterfaces());
907+
Queue<SootClass> worklist = new ArrayDeque<>(concreteType.getInterfaces());
908908
// we have to determine the "most specific super interface"
909909
while (!worklist.isEmpty()) {
910910
SootClass iFace = worklist.poll();
@@ -978,14 +978,15 @@ private SootMethod getSignaturePolymorphicMethod(SootClass concreteType, String
978978
if (concreteType == null) {
979979
throw new RuntimeException("The concreteType cannot not be null!");
980980
}
981+
boolean isDotNet = Options.v().src_prec() == Options.src_prec_dotnet;
981982
SootMethod candidate = null;
982983
for (SootMethod method : concreteType.getMethodsByNameAndParamCount(name, parameterTypes.size())) {
983984
if (method.getParameterTypes().equals(parameterTypes) && canStoreType(method.getReturnType(), returnType)) {
984985
candidate = method;
985986
returnType = method.getReturnType();
986987
}
987988
// if dotnet structs or generics
988-
if (Options.v().src_prec() == Options.src_prec_dotnet) {
989+
if (isDotNet) {
989990
if (method.getParameterCount() == parameterTypes.size() && canStoreType(returnType, method.getReturnType())) {
990991
boolean canStore = true;
991992
for (int i = 0; i < method.getParameterCount(); i++) {

0 commit comments

Comments
 (0)