Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84030 - trunk/boost/geometry/index/detail/rtree/visitors
From: adam.wulkiewicz_at_[hidden]
Date: 2013-04-24 08:35:31


Author: awulkiew
Date: 2013-04-24 08:35:30 EDT (Wed, 24 Apr 2013)
New Revision: 84030
URL: http://svn.boost.org/trac/boost/changeset/84030

Log:
geometry.index: experimental iterative query visitor increment() simplified.
Text files modified:
   trunk/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp | 23 +++++++++++------------
   1 files changed, 11 insertions(+), 12 deletions(-)

Modified: trunk/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp
==============================================================================
--- trunk/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp (original)
+++ trunk/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp 2013-04-24 08:35:30 EDT (Wed, 24 Apr 2013)
@@ -126,25 +126,24 @@
             // if leaf is choosen, move to the next value in leaf
             if ( values )
             {
- for ( ;; ++value_index )
+ if ( value_index < values->size() )
                 {
- // no more values, clear current leaf
- if ( values->size() <= value_index )
- {
- values = 0;
- value_index = 0;
- break;
- }
-
                     // return if next value is found
                     Value const& v = (*values)[value_index];
                     if ( index::detail::predicates_check<index::detail::value_tag, 0, predicates_len>(pred, v, tr(v)) )
                         return;
+
+ ++value_index;
+ }
+ // no more values, clear current leaf
+ else
+ {
+ values = 0;
+ value_index = 0;
                 }
             }
-
- // move to the next leaf if values aren't set
- while ( !values )
+ // if leaf isn't choosen, move to the next leaf
+ else
             {
                 // return if there is no more nodes to traverse
                 if ( internal_stack.empty() )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk