summaryrefslogtreecommitdiff
path: root/src/string.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-02-10 23:09:30 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-02-10 23:09:30 +0000
commit790e671f6cd34fc955dfc458b0a26a20a3fd8089 (patch)
tree2674a97bfc583fc39a4b19e8ed8da928bd8d27ce /src/string.cc
parent8714c414033cee64c6993305b0862ae9f3e88d31 (diff)
Replace some <cstring> function usage with c++ algorithms
Diffstat (limited to 'src/string.cc')
-rw-r--r--src/string.cc5
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)