0024645: Pointer to the last is wrong for a tree node
authorvro <vro@opencascade.com>
Thu, 6 Mar 2014 09:31:59 +0000 (13:31 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 6 Mar 2014 09:33:07 +0000 (13:33 +0400)
- An extra call to DownCast() is removed for a performance reason.
- Information on last child is added to the Dump() method + fixed a problem of lost last child tree node on removal (detach) operation.
- Test case for issue CR24645

src/TDataStd/TDataStd_TreeNode.cxx

index de47e20..2010048 100644 (file)
@@ -226,7 +226,7 @@ Standard_Boolean TDataStd_TreeNode::Remove ()
   }
 
   if (Father()->HasFirst()) {
   }
 
   if (Father()->HasFirst()) {
-    if (Handle(TDataStd_TreeNode)::DownCast(this) == Father()->First()) {
+    if (this == Father()->First().operator->()) {
       if (HasNext()) {
            Father()->SetFirst(Next());
       }
       if (HasNext()) {
            Father()->SetFirst(Next());
       }