Skip to content

Commit

Permalink
TIL that javac optimizes toArray calls with empty array instantiation (
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-bader authored Nov 2, 2022
1 parent 6e543ee commit 6d795ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/getkeepsafe/dexcount/PackageTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,11 @@ private static com.getkeepsafe.dexcount.thrift.MethodRef methodRefToThrift(Metho
}

private static MethodRef methodRefFromThrift(com.getkeepsafe.dexcount.thrift.MethodRef methodRef) {
String[] argTypes = new String[0];
String[] argTypes;
if (methodRef.argumentTypes != null) {
argTypes = methodRef.argumentTypes.toArray(argTypes);
argTypes = methodRef.argumentTypes.toArray(new String[0]);
} else {
argTypes = new String[0];
}

return new MethodRef(
Expand Down

0 comments on commit 6d795ce

Please sign in to comment.