[PPL-devel] [GIT] ppl/ppl(sparse_matrices): CO_Tree: fix compiler error in debug mode.

Marco Poletti poletti.marco at gmail.com
Fri May 7 08:29:49 CEST 2010


Module: ppl/ppl
Branch: sparse_matrices
Commit: 583486b8638b3862ae004b1bb4dbb4a87e2baecc
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=583486b8638b3862ae004b1bb4dbb4a87e2baecc

Author: Marco Poletti <poletti.marco at gmail.com>
Date:   Fri May  7 07:33:08 2010 +0200

CO_Tree: fix compiler error in debug mode.

---

 src/CO_Tree.inlines.hh |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/CO_Tree.inlines.hh b/src/CO_Tree.inlines.hh
index 617ea7b..59e3dcf 100644
--- a/src/CO_Tree.inlines.hh
+++ b/src/CO_Tree.inlines.hh
@@ -1031,12 +1031,14 @@ CO_Tree::inorder_iterator::get_next_value() {
         get_parent();
     }
 
+#ifndef NDEBUG
     if (!is_at_end())
       // previous_index could be unused_index because we deleted the current
       // node, as we do in move_data_from().
       if (previous_index != unused_index)
-      PPL_ASSERT((*this)->first != unused_index
-                 && (*this)->first > previous_index);
+        PPL_ASSERT((*this)->first != unused_index
+                   && (*this)->first > previous_index);
+#endif
   }
 #endif // defined(USE_PPL_CO_TREE_VEB_LAYOUT) || defined(USE_PPL_CO_TREE_BFS_LAYOUT)
 
@@ -1678,12 +1680,14 @@ CO_Tree::inorder_const_iterator::get_next_value() {
         get_parent();
     }
 
+#ifndef NDEBUG
     if (!is_at_end())
       // previous_index could be unused_index because we deleted the current
       // node, as we do in move_data_from().
       if (previous_index != unused_index)
-      PPL_ASSERT((*this)->first != unused_index
-                 && (*this)->first > previous_index);
+        PPL_ASSERT((*this)->first != unused_index
+                   && (*this)->first > previous_index);
+#endif
   }
 #endif // defined(USE_PPL_CO_TREE_VEB_LAYOUT) || defined(USE_PPL_CO_TREE_BFS_LAYOUT)
 




More information about the PPL-devel mailing list