Setting the length of the new array to optimize speed

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1088439 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2011-04-03 23:35:59 +00:00
parent a859fffc0a
commit f5a6dc28f5
2 changed files with 2 additions and 2 deletions

View File

@ -551,7 +551,7 @@ public class ExceptionUtils {
frames.add(trace.get(j));
}
}
return frames.toArray(new String[0]);
return frames.toArray(new String[frames.size()]);
}
/**

View File

@ -886,7 +886,7 @@ public class TypeUtils {
}
}
return types.toArray(new Type[0]);
return types.toArray(new Type[types.size()]);
}
/**