Skip to content

Commit d9eb9e5

Browse files
committed
Revert "Avoid recalculating node length"
ca74a2c
1 parent ca74a2c commit d9eb9e5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/org/apache/ibatis/parsing/XNode.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,11 @@ private StringBuilder buildToString(StringBuilder builder, int indent) {
294294
}
295295

296296
NodeList nodeList = node.getChildNodes();
297-
int nodeLen = nodeList.getLength();
298-
if (nodeList == null || nodeLen == 0) {
297+
if (nodeList == null || nodeList.getLength() == 0) {
299298
builder.append(" />\n");
300299
} else {
301300
builder.append(">\n");
302-
for (int i = 0, n = nodeLen; i < n; i++) {
301+
for (int i = 0, n = nodeList.getLength(); i < n; i++) {
303302
Node node = nodeList.item(i);
304303
short nodeType = node.getNodeType();
305304
if (nodeType == Node.ELEMENT_NODE) {

0 commit comments

Comments
 (0)