From 82b3fe985b8d87b83fd965f248e9193ce35d5d0f Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 13 Mar 2011 16:09:47 +0000 Subject: [PATCH] Performance fix for get_turns/partition [SVN r69958] --- .../algorithms/detail/overlay/get_turns.hpp | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp index b3b69944d..072164d72 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp @@ -367,19 +367,23 @@ struct section_visitor template inline bool apply(Section const& sec1, Section const& sec2) { - return get_turns_in_sections - < - Geometry1, - Geometry2, - Reverse1, Reverse2, - Section, Section, - Turns, - TurnPolicy, - InterruptPolicy - >::apply( - m_source_id1, m_geometry1, sec1, - m_source_id2, m_geometry2, sec2, - m_turns, m_interrupt_policy); + if (! detail::disjoint::disjoint_box_box(sec1.bounding_box, sec2.bounding_box)) + { + return get_turns_in_sections + < + Geometry1, + Geometry2, + Reverse1, Reverse2, + Section, Section, + Turns, + TurnPolicy, + InterruptPolicy + >::apply( + m_source_id1, m_geometry1, sec1, + m_source_id2, m_geometry2, sec2, + m_turns, m_interrupt_policy); + } + return true; } };