summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression_algo.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-06-21 14:52:55 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2016-07-07 11:28:34 -0400
commit582818dac41ac01975820c09f79d3b86dc3782cc (patch)
tree6aef7efec5f12763fe2286ad722e70bdf44205a5 /src/mongo/db/matcher/expression_algo.cpp
parente39c46b27f4ae58f96b685dd625b0165761fee0d (diff)
downloadmongo-582818dac41ac01975820c09f79d3b86dc3782cc.tar.gz
SERVER-23882 Collation should be considered part of a query's shape
Diffstat (limited to 'src/mongo/db/matcher/expression_algo.cpp')
-rw-r--r--src/mongo/db/matcher/expression_algo.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/mongo/db/matcher/expression_algo.cpp b/src/mongo/db/matcher/expression_algo.cpp
index 6365d3326bb..d918ead80f9 100644
--- a/src/mongo/db/matcher/expression_algo.cpp
+++ b/src/mongo/db/matcher/expression_algo.cpp
@@ -46,19 +46,6 @@ using std::unique_ptr;
namespace {
-bool isComparisonMatchExpression(const MatchExpression* expr) {
- switch (expr->matchType()) {
- case MatchExpression::LT:
- case MatchExpression::LTE:
- case MatchExpression::EQ:
- case MatchExpression::GTE:
- case MatchExpression::GT:
- return true;
- default:
- return false;
- }
-}
-
bool supportsEquality(const ComparisonMatchExpression* expr) {
switch (expr->matchType()) {
case MatchExpression::LTE:
@@ -153,7 +140,7 @@ bool _isSubsetOf(const MatchExpression* lhs, const ComparisonMatchExpression* rh
return false;
}
- if (isComparisonMatchExpression(lhs)) {
+ if (ComparisonMatchExpression::isComparisonMatchExpression(lhs)) {
return _isSubsetOf(static_cast<const ComparisonMatchExpression*>(lhs), rhs);
}
@@ -188,7 +175,7 @@ bool _isSubsetOf(const MatchExpression* lhs, const ExistsMatchExpression* rhs) {
return false;
}
- if (isComparisonMatchExpression(lhs)) {
+ if (ComparisonMatchExpression::isComparisonMatchExpression(lhs)) {
const ComparisonMatchExpression* cme = static_cast<const ComparisonMatchExpression*>(lhs);
// CompareMatchExpression::init() prohibits creating a match expression with EOO or
// Undefined types, so only need to ensure that the value is not of type jstNULL.
@@ -338,7 +325,7 @@ bool isSubsetOf(const MatchExpression* lhs, const MatchExpression* rhs) {
return true;
}
- if (isComparisonMatchExpression(rhs)) {
+ if (ComparisonMatchExpression::isComparisonMatchExpression(rhs)) {
return _isSubsetOf(lhs, static_cast<const ComparisonMatchExpression*>(rhs));
}