Remove DCHECK_GE checks from fixed_array.h
This triggers -Wtype-limits warnings on comparisons
which are always true, since the test being done is
n >= 0, where n is of type size_t, which is always
true.
This causes problems when compiling Ceres on linux
with miniglog.
Change-Id: Ia1d1d1483e03469c71fde029b62ca6d84e9b27e0
diff --git a/include/ceres/internal/fixed_array.h b/include/ceres/internal/fixed_array.h
index ee264d1..694070b 100644
--- a/include/ceres/internal/fixed_array.h
+++ b/include/ceres/internal/fixed_array.h
@@ -113,7 +113,6 @@
// REQUIRES: 0 <= i < size()
// Returns a reference to the "i"th element.
inline T& operator[](size_type i) {
- DCHECK_GE(i, 0);
DCHECK_LT(i, size_);
return array_[i].element;
}
@@ -121,7 +120,6 @@
// REQUIRES: 0 <= i < size()
// Returns a reference to the "i"th element.
inline const T& operator[](size_type i) const {
- DCHECK_GE(i, 0);
DCHECK_LT(i, size_);
return array_[i].element;
}
@@ -168,8 +166,6 @@
array_((n <= kInlineElements
? reinterpret_cast<InnerContainer*>(inline_space_)
: new InnerContainer[n])) {
- DCHECK_GE(n, size_t(0));
-
// Construct only the elements actually used.
if (array_ == reinterpret_cast<InnerContainer*>(inline_space_)) {
for (size_t i = 0; i != size_; ++i) {