summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim King <taking@google.com>2017-07-17 11:04:24 -0700
committerTim King <taking@google.com>2017-07-17 11:04:24 -0700
commit8cf852387cb3a6ec17e77e61956030ca0c4c3837 (patch)
treefd700b89ff9626b400d7fce82e908f82c0177c03
parent7366c27f348adfe919fad3a16ee769e9215405c0 (diff)
Fixing the order of the comparison operation.
-rw-r--r--src/util/regexp.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/regexp.cpp b/src/util/regexp.cpp
index 6afadfd5b..f8fc1833c 100644
--- a/src/util/regexp.cpp
+++ b/src/util/regexp.cpp
@@ -34,11 +34,11 @@ static_assert(UCHAR_MAX == 255, "Unsigned char is assumed to have 256 values.");
int String::cmp(const String &y) const {
if (size() != y.size()) {
- return size() < y.size() ? 1 : -1;
+ return size() < y.size() ? -1 : 1;
}
for (unsigned int i = 0; i < size(); ++i) {
if (d_str[i] != y.d_str[i]) {
- return getUnsignedCharAt(i) < y.getUnsignedCharAt(i) ? 1 : -1;
+ return getUnsignedCharAt(i) < y.getUnsignedCharAt(i) ? -1 : 1;
}
}
return 0;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback