[MOAB-dev] r1702 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Tue Mar 25 15:51:56 CDT 2008


Author: kraftche
Date: 2008-03-25 15:51:56 -0500 (Tue, 25 Mar 2008)
New Revision: 1702

Modified:
   MOAB/trunk/MBAdaptiveKDTree.cpp
Log:
fix step off beginning of array

Modified: MOAB/trunk/MBAdaptiveKDTree.cpp
===================================================================
--- MOAB/trunk/MBAdaptiveKDTree.cpp	2008-03-25 20:41:17 UTC (rev 1701)
+++ MOAB/trunk/MBAdaptiveKDTree.cpp	2008-03-25 20:51:56 UTC (rev 1702)
@@ -1693,7 +1693,7 @@
                 dists_out.resize( dists_out.size() + 1 );
               }
               int w = tris_out.size() - 1;
-              for (; tri_t < dists_out[w-1] && w > 0; --w) {
+              for (; w > 0 && tri_t < dists_out[w-1]; --w) {
                 tris_out[w] = tris_out[w-1];
                 dists_out[w] = dists_out[w-1];
               }




More information about the moab-dev mailing list