File tree Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Expand file tree Collapse file tree 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ class GeoNear2DStage::DensityEstimator {
288288 // Since appendVertexNeighbors(level, output) requires level < hash.getBits(),
289289 // we have to start to find documents at most GeoHash::kMaxBits - 1. Thus the finest
290290 // search area is 16 * finest cell area at GeoHash::kMaxBits.
291- _currentLevel = std::max (0 , hashParams.bits - 1 );
291+ _currentLevel = std::max (0u , hashParams.bits - 1u );
292292 }
293293
294294 PlanStage::StageState work (OperationContext* opCtx,
Original file line number Diff line number Diff line change @@ -68,13 +68,15 @@ R2RegionCoverer::R2RegionCoverer(GeoHashConverter* hashConverter)
6868R2RegionCoverer::~R2RegionCoverer () {}
6969
7070void R2RegionCoverer::setMinLevel (unsigned int minLevel) {
71+ dassert (minLevel >= 0 );
7172 dassert (minLevel <= GeoHash::kMaxBits );
72- _minLevel = min (GeoHash::kMaxBits , minLevel);
73+ _minLevel = max ( 0u , min (GeoHash::kMaxBits , minLevel) );
7374}
7475
7576void R2RegionCoverer::setMaxLevel (unsigned int maxLevel) {
77+ dassert (maxLevel >= 0 );
7678 dassert (maxLevel <= GeoHash::kMaxBits );
77- _maxLevel = min (GeoHash::kMaxBits , maxLevel);
79+ _maxLevel = max ( 0u , min (GeoHash::kMaxBits , maxLevel) );
7880}
7981
8082void R2RegionCoverer::setMaxCells (int maxCells) {
Original file line number Diff line number Diff line change @@ -27,13 +27,7 @@ using std::vector;
2727 return static_cast <IntOut>(x < 0 ? (x - 0.5 ) : (x + 0.5 ));
2828 }
2929
30- // MONGODB suppress clang-4.0 warning by disabling the following line, but leave it in for MSVC
31- // since removing it results in a linker error there.
32- // error: explicit instantiation of 'Round<int, double>' that occurs after an explicit
33- // specialization has no effect [-Werror,-Winstantiation-after-specialization]
34- #ifdef _MSC_VER
3530template int MathUtil::Round<int ,double >(double x);
36- #endif
3731
3832MathUtil::QuadraticRootType MathUtil::RealRootsForQuadratic (long double a,
3933 long double b,
You can’t perform that action at this time.
0 commit comments