Skip to content

Commit 0608291

Browse files
committed
fix, last optimization was a bit too much
1 parent 712d389 commit 0608291

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/org/htmlunit/html/impl/SimpleRange.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,7 @@ private static void deleteBefore(final DomNode node, int offset) {
521521
}
522522
else {
523523
final DomNodeList<DomNode> children = node.getChildNodes();
524-
final int length = children.getLength();
525-
for (int i = 0; i < offset && i < length; i++) {
524+
for (int i = 0; i < offset && i < children.getLength(); i++) {
526525
final DomNode child = children.get(i);
527526
child.remove();
528527
i--;
@@ -541,8 +540,7 @@ private static void deleteAfter(final DomNode node, final int offset) {
541540
}
542541
else {
543542
final DomNodeList<DomNode> children = node.getChildNodes();
544-
final int length = children.getLength();
545-
for (int i = offset; i < length; i++) {
543+
for (int i = offset; i < children.getLength(); i++) {
546544
final DomNode child = children.get(i);
547545
child.remove();
548546
i--;

0 commit comments

Comments
 (0)