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 3149bc4 commit 151c2ddCopy full SHA for 151c2dd
yql/essentials/sql/v1/lexer/regex/generic.cpp
@@ -139,7 +139,11 @@ namespace NSQLTranslationV1 {
139
}));
140
141
Sort(patterns, [](const TRegexPattern& lhs, const TRegexPattern& rhs) {
142
- return lhs.Body.length() > rhs.Body.length();
+ const auto lhs_length = lhs.Body.length();
143
+ const auto rhs_length = rhs.Body.length();
144
+
145
+ // Note: do not compare After and Before here as they are equal.
146
+ return std::tie(lhs_length, lhs.Body) > std::tie(rhs_length, rhs.Body);
147
});
148
149
TStringBuilder body;
0 commit comments