From 30a71a57efa91c24ce8daea53503c0c77d453dae Mon Sep 17 00:00:00 2001 From: ZZZank <3410764033@qq.com> Date: Mon, 25 Mar 2024 18:21:36 +0800 Subject: [PATCH] set new list to be zero-capacity before filling , to save a little space --- src/main/java/com/probejs/info/ClassInfo.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/probejs/info/ClassInfo.java b/src/main/java/com/probejs/info/ClassInfo.java index ce45c75f..2fe04b59 100644 --- a/src/main/java/com/probejs/info/ClassInfo.java +++ b/src/main/java/com/probejs/info/ClassInfo.java @@ -64,10 +64,10 @@ private ClassInfo(Class clazz) { interfaces = Arrays.stream(clazzRaw.getInterfaces()).map(ClassInfo::ofCache).collect(Collectors.toList()); - constructorInfo = new ArrayList<>(); - parameters = new ArrayList<>(); - methodInfo = new ArrayList<>(); - fieldInfo = new ArrayList<>(); + constructorInfo = new ArrayList<>(0); + parameters = new ArrayList<>(0); + methodInfo = new ArrayList<>(0); + fieldInfo = new ArrayList<>(0); try { constructorInfo.addAll( Arrays