summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pugixml.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 1422eb0..da6d447 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -5479,13 +5479,13 @@ PUGI__NS_BEGIN
template <typename I> void reverse(I begin, I end)
{
- while (begin + 1 < end) swap(*begin++, *--end);
+ while (end - begin > 1) swap(*begin++, *--end);
}
template <typename I> I unique(I begin, I end)
{
// fast skip head
- while (begin + 1 < end && *begin != *(begin + 1)) begin++;
+ while (end - begin > 1 && *begin != *(begin + 1)) begin++;
if (begin == end) return begin;