Applying Dave Brosius patch from xalanj-2221 which
changes a loop over i that copies values from one
array to another to a System.arraycopy() that should
run faster.
diff --git a/src/org/apache/xalan/processor/XSLTSchema.java b/src/org/apache/xalan/processor/XSLTSchema.java
index 02f606f..80c2a97 100644
--- a/src/org/apache/xalan/processor/XSLTSchema.java
+++ b/src/org/apache/xalan/processor/XSLTSchema.java
@@ -613,19 +613,13 @@
templateElements[i++] = exsltFunction;
templateElements[i++] = exsltResult;
- int k;
-
- for (k = 0; k < i; k++)
- {
- templateElementsAndParams[k] = templateElements[k];
- templateElementsAndSort[k] = templateElements[k];
- exsltFunctionElements[k] = templateElements[k];
-
- }
-
- templateElementsAndParams[k] = xslParam;
- templateElementsAndSort[k] = xslSort;
- exsltFunctionElements[k] = xslParam;
+ System.arraycopy(templateElements, 0, templateElementsAndParams, 0, i);
+ System.arraycopy(templateElements, 0, templateElementsAndSort, 0, i);
+ System.arraycopy(templateElements, 0, exsltFunctionElements, 0, i);
+
+ templateElementsAndParams[i] = xslParam;
+ templateElementsAndSort[i] = xslSort;
+ exsltFunctionElements[i] = xslParam;
i = 0;
charTemplateElements[i++] = charData; // #PCDATA