Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/buffer_vector.hpp9
-rw-r--r--std/algorithm.hpp1
2 files changed, 2 insertions, 8 deletions
diff --git a/base/buffer_vector.hpp b/base/buffer_vector.hpp
index ca31a9f65d..cee3ab2175 100644
--- a/base/buffer_vector.hpp
+++ b/base/buffer_vector.hpp
@@ -257,12 +257,5 @@ inline bool operator!=(buffer_vector<T, N1> const & v1, buffer_vector<T, N2> con
template <typename T, size_t N1, size_t N2>
inline bool operator<(buffer_vector<T, N1> const & v1, buffer_vector<T, N2> const & v2)
{
- const size_t N = std::min(v1.size(), v2.size());
- for (size_t i = 0; i < N; ++i)
- {
- if (!(v1[i] == v2[i]))
- return v1[i] < v2[i];
- }
-
- return ((v1.size() != v2.size()) && (v1.size() == N));
+ return lexicographical_compare(v1.begin(), v1.end(), v2.begin(), v2.end());
}
diff --git a/std/algorithm.hpp b/std/algorithm.hpp
index a570667e5f..6f5bbc8bb9 100644
--- a/std/algorithm.hpp
+++ b/std/algorithm.hpp
@@ -8,6 +8,7 @@
#include <algorithm>
using std::equal;
+using std::lexicographical_compare;
using std::lower_bound;
using std::max;
using std::max_element;