Skip to content

Commit 194b5e4

Browse files
committed
used QLatin1String() for some operators
1 parent 482eeba commit 194b5e4

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/orm/query/grammars/postgresgrammar.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ const QVector<QString> &PostgresGrammar::getOperators() const
8585
{
8686
static const QVector<QString> cachedOperators {
8787
EQ, LT, GT, LE, GE, NE, NE_,
88-
LIKE, NLIKE, "between", ILIKE, "not ilike",
88+
LIKE, NLIKE, QLatin1String("between"), ILIKE, QLatin1String("not ilike"),
8989
"~", B_AND, B_OR, "#", "<<", ">>", "<<=", ">>=",
90-
AND_, "@>", "<@", "?", "?|", "?&", OR_, "-", "@?", "@@", "#-",
91-
"is distinct from", "is not distinct from",
90+
AND_, "@>", "<@", "?", "?|", "?&", OR_, MINUS, "@?", "@@", "#-",
91+
QLatin1String("is distinct from"), QLatin1String("is not distinct from"),
9292
};
9393

9494
return cachedOperators;

src/orm/query/grammars/sqlitegrammar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const QVector<QString> &SQLiteGrammar::getOperators() const
7777
static const QVector<QString> cachedOperators {
7878
EQ, LT, GT, LE, GE, NE_, NE,
7979
LIKE, NLIKE, ILIKE,
80-
B_AND, B_OR, "<<", ">>",
80+
B_AND, B_OR, QLatin1String("<<"), QLatin1String(">>"),
8181
};
8282

8383
return cachedOperators;

src/orm/query/querybuilder.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,12 +1735,13 @@ void Builder::checkBindingType(const BindingType type) const
17351735
const QVector<QString> &Builder::getOperators()
17361736
{
17371737
static const QVector<QString> cachedOperators {
1738-
EQ, LT, GT, LE, GE, NE_, NE, "<=>",
1739-
LIKE, "like binary", NLIKE, ILIKE,
1738+
EQ, LT, GT, LE, GE, NE_, NE, QLatin1String("<=>"),
1739+
LIKE, QLatin1String("like binary"), NLIKE, ILIKE,
17401740
B_AND, B_OR, "^", "<<", ">>", "&~",
1741-
"rlike", "not rlike", "regexp", "not regexp",
1742-
"~", "~*", "!~", "!~*", "similar to",
1743-
"not similar to", "not ilike", "~~*", "!~~*",
1741+
QLatin1String("rlike"), QLatin1String("not rlike"),
1742+
QLatin1String("regexp"), QLatin1String("not regexp"),
1743+
"~", "~*", "!~", "!~*", QLatin1String("similar to"),
1744+
QLatin1String("not similar to"), QLatin1String("not ilike"), "~~*", "!~~*",
17441745
};
17451746

17461747
return cachedOperators;

0 commit comments

Comments
 (0)