From c92269e4f2caa9e036d0cc6ddee56c092bf36fd2 Mon Sep 17 00:00:00 2001 From: hduelme Date: Sun, 12 Feb 2023 18:53:29 +0100 Subject: [PATCH] use bulk operation addAll instead of iteration --- .../xml/xsd/commons/CommonsXsdSchemaCollection.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java index b9b1d6931..6f9749175 100644 --- a/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java +++ b/spring-xml/src/main/java/org/springframework/xml/xsd/commons/CommonsXsdSchemaCollection.java @@ -189,10 +189,7 @@ private void inlineIncludes(XmlSchema schema, Set processedIncludes, if (!processedIncludes.contains(includedSchema)) { inlineIncludes(includedSchema, processedIncludes, processedImports); findImports(includedSchema, processedImports, processedIncludes); - List includeItems = includedSchema.getItems(); - for (XmlSchemaObject includedItem : includeItems) { - schemaItems.add(includedItem); - } + schemaItems.addAll(includedSchema.getItems()); } // remove the schemaItems.remove(i);