From: Tim King Date: Mon, 17 Jul 2017 18:04:24 +0000 (-0700) Subject: Fixing the order of the comparison operation. X-Git-Tag: cvc5-1.0.0~5668^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8cf852387cb3a6ec17e77e61956030ca0c4c3837;p=cvc5.git Fixing the order of the comparison operation. --- 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;