commit | c35f8141d4c4f90faae6c617ce11e58691cc1a90 | [log] [tgz] |
---|---|---|
author | nsandonato <nsandonato> | Fri Jan 14 16:56:23 2011 +0000 |
committer | nsandonato <nsandonato> | Fri Jan 14 16:56:23 2011 +0000 |
tree | d98de692c6e6975a4b0ad7125a267256038fab25 | |
parent | 1d243f491fa1bafbcf9c486ef9d4be685486e4f2 [diff] |
[nobug] performance: invoke .size() only once instead of on every iteration.
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java index 035ad92..3e278a5 100644 --- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java +++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/formatter/DefaultXMLPartitionFormatter.java
@@ -894,7 +894,8 @@ if (indentMultipleAttribute) { int attributesCount = 0; int i = 2; - while (i < textRegions.size() && attributesCount < 2) { + final int size = textRegions.size(); + while (i < size && attributesCount < 2) { if (DOMRegionContext.XML_TAG_ATTRIBUTE_NAME.equals(textRegions.get(i).getType())) { ++attributesCount; }