diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-02-10 23:09:30 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-02-10 23:09:30 +0000 |
| commit | 790e671f6cd34fc955dfc458b0a26a20a3fd8089 (patch) | |
| tree | 2674a97bfc583fc39a4b19e8ed8da928bd8d27ce /src/string.cc | |
| parent | 8714c414033cee64c6993305b0862ae9f3e88d31 (diff) | |
Replace some <cstring> function usage with c++ algorithms
Diffstat (limited to 'src/string.cc')
| -rw-r--r-- | src/string.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/string.cc b/src/string.cc index dab1d2fe..db2a7e21 100644 --- a/src/string.cc +++ b/src/string.cc @@ -11,10 +11,7 @@ namespace Kakoune bool operator<(StringView lhs, StringView rhs) { - int cmp = strncmp(lhs.data(), rhs.data(), (int)std::min(lhs.length(), rhs.length())); - if (cmp == 0) - return lhs.length() < rhs.length(); - return cmp < 0; + return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); } Vector<String> split(StringView str, char separator, char escape) |
