Some very simple improvements regarding ArrayList
This commit is contained in:
committed by
Juergen Hoeller
parent
5e0cd9fb60
commit
92053bb84e
@@ -936,8 +936,7 @@ public abstract class StringUtils {
|
||||
return array1;
|
||||
}
|
||||
|
||||
List<String> result = new ArrayList<>();
|
||||
result.addAll(Arrays.asList(array1));
|
||||
List<String> result = new ArrayList<>(Arrays.asList(array1));
|
||||
for (String str : array2) {
|
||||
if (!result.contains(str)) {
|
||||
result.add(str);
|
||||
|
||||
Reference in New Issue
Block a user