Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76733 - trunk/boost/geometry/algorithms/detail/overlay
From: barend.gehrels_at_[hidden]
Date: 2012-01-28 07:01:11


Author: barendgehrels
Date: 2012-01-28 07:01:11 EST (Sat, 28 Jan 2012)
New Revision: 76733
URL: http://svn.boost.org/trac/boost/changeset/76733

Log:
Moved check on input size such that they are together
Text files modified:
   trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp | 21 +++++++++++----------
   1 files changed, 11 insertions(+), 10 deletions(-)

Modified: trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp 2012-01-28 07:01:11 EST (Sat, 28 Jan 2012)
@@ -145,11 +145,21 @@
                 OutputIterator out,
                 Strategy const& )
     {
- if (geometry::num_points(geometry1) == 0 && geometry::num_points(geometry2) == 0)
+ if (geometry::num_points(geometry1) == 0
+ && geometry::num_points(geometry2) == 0)
         {
             return out;
         }
 
+ if (geometry::num_points(geometry1) == 0
+ || geometry::num_points(geometry2) == 0)
+ {
+ return return_if_one_input_is_empty
+ <
+ GeometryOut, Direction, ReverseOut
+ >(geometry1, geometry2, out);
+ }
+
         typedef typename geometry::point_type<GeometryOut>::type point_type;
         typedef detail::overlay::traversal_turn_info<point_type> turn_info;
         typedef std::deque<turn_info> container_type;
@@ -159,15 +169,6 @@
                 typename geometry::ring_type<GeometryOut>::type
> ring_container_type;
 
- if (geometry::num_points(geometry1) == 0
- || geometry::num_points(geometry2) == 0)
- {
- return return_if_one_input_is_empty
- <
- GeometryOut, Direction, ReverseOut
- >(geometry1, geometry2, out);
- }
-
         container_type turn_points;
 
 #ifdef BOOST_GEOMETRY_TIME_OVERLAY


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