[MOAB-dev] r2546 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Wed Jan 14 15:41:23 CST 2009


Author: kraftche
Date: 2009-01-14 15:41:23 -0600 (Wed, 14 Jan 2009)
New Revision: 2546

Modified:
   MOAB/trunk/MBRange.cpp
Log:
fix bug in MBRange::insert when hint is past correct insert position

Modified: MOAB/trunk/MBRange.cpp
===================================================================
--- MOAB/trunk/MBRange.cpp	2009-01-14 15:48:20 UTC (rev 2545)
+++ MOAB/trunk/MBRange.cpp	2009-01-14 21:41:23 UTC (rev 2546)
@@ -314,9 +314,13 @@
   }
   
   PairNode* iter = prev.mNode;
-  if (iter == &mHead)
+    // If iterator is at end, set it to last.
+    // Thus if the hint was to append, we start searching
+    // at the end of the list.
+  if (iter == &mHead) 
     iter = mHead.mPrev;
-  if ( iter->mPrev == &mHead || iter->mPrev->second+1 < val1 )
+    // if hint (prev) is past insert position, reset it to the beginning.
+  if (iter != &mHead && iter->first > val2+1)
     iter = mHead.mNext;
   
   // Input range is before beginning?




More information about the moab-dev mailing list