Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6969c6d commit d33e808Copy full SHA for d33e808
include/network/string_view.hpp
@@ -161,8 +161,12 @@ class basic_string_view {
161
}
162
163
constexpr int compare(basic_string_view s) const noexcept {
164
- return (size() != s.size()) ? (size() < s.size()) ? -1 : 1
165
- : traits::compare(data(), s.data(), size());
+ return size() == s.size()
+ ? traits::compare(data(), s.data(), size())
166
+ : (size() < s.size()
167
+ ? (traits::compare(data(), s.data(), size()) > 0 ? 1 : -1)
168
+ : (traits::compare(data(), s.data(), size()) < 0 ? -1
169
+ : 1));
170
171
172
constexpr int compare(size_type pos1, size_type n1,
0 commit comments