summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-06-30 14:09:35 -0400
committerMathias Stearn <mathias@10gen.com>2017-07-13 16:53:12 -0400
commit8204c7dacf17851057dda165e6d1638cbff70cbf (patch)
tree3fbdbb27d02f37c3cc2ad994cc9ea6ce87aab407 /src/mongo/db
parent26ff40f21fabb2ac28405f6ebbca5c45f19bc760 (diff)
downloadmongo-8204c7dacf17851057dda165e6d1638cbff70cbf.tar.gz
SERVER-29887 address clang-4.0 warnings in geo code
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/exec/geo_near.cpp2
-rw-r--r--src/mongo/db/geo/r2_region_coverer.cpp6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/exec/geo_near.cpp b/src/mongo/db/exec/geo_near.cpp
index 9bb94def100..49ee2feb6f9 100644
--- a/src/mongo/db/exec/geo_near.cpp
+++ b/src/mongo/db/exec/geo_near.cpp
@@ -288,7 +288,7 @@ public:
// Since appendVertexNeighbors(level, output) requires level < hash.getBits(),
// we have to start to find documents at most GeoHash::kMaxBits - 1. Thus the finest
// search area is 16 * finest cell area at GeoHash::kMaxBits.
- _currentLevel = std::max(0u, hashParams.bits - 1u);
+ _currentLevel = std::max(0, hashParams.bits - 1);
}
PlanStage::StageState work(OperationContext* opCtx,
diff --git a/src/mongo/db/geo/r2_region_coverer.cpp b/src/mongo/db/geo/r2_region_coverer.cpp
index 47ba2528328..4d7791dc1e3 100644
--- a/src/mongo/db/geo/r2_region_coverer.cpp
+++ b/src/mongo/db/geo/r2_region_coverer.cpp
@@ -68,15 +68,13 @@ R2RegionCoverer::R2RegionCoverer(GeoHashConverter* hashConverter)
R2RegionCoverer::~R2RegionCoverer() {}
void R2RegionCoverer::setMinLevel(unsigned int minLevel) {
- dassert(minLevel >= 0);
dassert(minLevel <= GeoHash::kMaxBits);
- _minLevel = max(0u, min(GeoHash::kMaxBits, minLevel));
+ _minLevel = min(GeoHash::kMaxBits, minLevel);
}
void R2RegionCoverer::setMaxLevel(unsigned int maxLevel) {
- dassert(maxLevel >= 0);
dassert(maxLevel <= GeoHash::kMaxBits);
- _maxLevel = max(0u, min(GeoHash::kMaxBits, maxLevel));
+ _maxLevel = min(GeoHash::kMaxBits, maxLevel);
}
void R2RegionCoverer::setMaxCells(int maxCells) {