diff --git a/src/xercesc/dom/impl/DOMRangeImpl.cpp b/src/xercesc/dom/impl/DOMRangeImpl.cpp
index fb8e3f16052546e0dc6db7ac47a572e3370d8416..1cc4147ca5996bf004c2fb7980f7110c87dee790 100644
--- a/src/xercesc/dom/impl/DOMRangeImpl.cpp
+++ b/src/xercesc/dom/impl/DOMRangeImpl.cpp
@@ -1025,8 +1025,6 @@ DOMNode* DOMRangeImpl::nextNode(const DOMNode* node, bool visitChildren) const
             return result;
         } else {
             parent = parent->getParentNode();
-            if (parent == fEndContainer) return parent;
-
         }
 
     }