diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-07-14 15:06:39 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-07-14 15:06:39 -0400 |
commit | a9a2772d214b6839ebffaa8c547c1628ffe62e99 (patch) | |
tree | a8196bf645fb2d97ff264b2228e6cfd3741adc8d /src/mongo/db/geo | |
parent | 3848e767426d616253f022578db75cc384e3ff1d (diff) | |
download | mongo-a9a2772d214b6839ebffaa8c547c1628ffe62e99.tar.gz |
Revert "SERVER-29887 address clang-4.0 warnings in geo code"
This reverts commit 8204c7dacf17851057dda165e6d1638cbff70cbf.
Diffstat (limited to 'src/mongo/db/geo')
-rw-r--r-- | src/mongo/db/geo/r2_region_coverer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/geo/r2_region_coverer.cpp b/src/mongo/db/geo/r2_region_coverer.cpp index 4d7791dc1e3..47ba2528328 100644 --- a/src/mongo/db/geo/r2_region_coverer.cpp +++ b/src/mongo/db/geo/r2_region_coverer.cpp @@ -68,13 +68,15 @@ R2RegionCoverer::R2RegionCoverer(GeoHashConverter* hashConverter) R2RegionCoverer::~R2RegionCoverer() {} void R2RegionCoverer::setMinLevel(unsigned int minLevel) { + dassert(minLevel >= 0); dassert(minLevel <= GeoHash::kMaxBits); - _minLevel = min(GeoHash::kMaxBits, minLevel); + _minLevel = max(0u, min(GeoHash::kMaxBits, minLevel)); } void R2RegionCoverer::setMaxLevel(unsigned int maxLevel) { + dassert(maxLevel >= 0); dassert(maxLevel <= GeoHash::kMaxBits); - _maxLevel = min(GeoHash::kMaxBits, maxLevel); + _maxLevel = max(0u, min(GeoHash::kMaxBits, maxLevel)); } void R2RegionCoverer::setMaxCells(int maxCells) { |