[algorithms][is_valid] rename method find_not_equal to find_different_from_first (for clarity)

This commit is contained in:
Menelaos Karavelas
2015-07-14 20:42:16 +03:00
parent 73960f31ca
commit 4e5da910af

View File

@@ -79,7 +79,8 @@ template <typename Range, closure_selector Closure>
struct has_spikes
{
template <typename Iterator>
static inline Iterator find_not_equal(Iterator first, Iterator last)
static inline Iterator find_different_from_first(Iterator first,
Iterator last)
{
typedef not_equal_to<typename point_type<Range>::type> not_equal;
@@ -105,7 +106,7 @@ struct has_spikes
iterator prev = boost::begin(view);
iterator cur = find_not_equal(prev, boost::end(view));
iterator cur = find_different_from_first(prev, boost::end(view));
if (cur == boost::end(view))
{
// the range has only one distinct point, so it
@@ -113,7 +114,7 @@ struct has_spikes
return ! visitor.template apply<no_failure>();
}
iterator next = find_not_equal(cur, boost::end(view));
iterator next = find_different_from_first(cur, boost::end(view));
if (next == boost::end(view))
{
// the range has only two distinct points, so it
@@ -132,7 +133,7 @@ struct has_spikes
}
prev = cur;
cur = next;
next = find_not_equal(cur, boost::end(view));
next = find_different_from_first(cur, boost::end(view));
}
if (geometry::equals(range::front(view), range::back(view)))
@@ -141,10 +142,10 @@ struct has_spikes
typename boost::range_reverse_iterator
<
view_type const
>::type prev = find_not_equal(boost::rbegin(view),
boost::rend(view));
>::type prev = find_different_from_first(boost::rbegin(view),
boost::rend(view));
iterator next = find_not_equal(cur, boost::end(view));
iterator next = find_different_from_first(cur, boost::end(view));
if (detail::point_is_spike_or_equal(*prev, *next, *cur))
{
return