Preloader: HashMap constructor takes capacity, not expected size
This commit is contained in:
@@ -108,7 +108,8 @@ public class ClassPreloadingUtils {
|
|||||||
int classNumberEstimate,
|
int classNumberEstimate,
|
||||||
ClassHandler handler
|
ClassHandler handler
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
Map<String, Object> resources = new HashMap<String, Object>(classNumberEstimate);
|
// 0.75 is HashMap.DEFAULT_LOAD_FACTOR
|
||||||
|
Map<String, Object> resources = new HashMap<String, Object>((int) (classNumberEstimate / 0.75));
|
||||||
|
|
||||||
for (File jarFile : jarFiles) {
|
for (File jarFile : jarFiles) {
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user