mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-30 09:00:37 +08:00
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
This commit is contained in:
@@ -113,7 +113,6 @@ class FixedArray {
|
||||
// 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 @@ class FixedArray {
|
||||
// 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 @@ inline FixedArray<T, S>::FixedArray(typename FixedArray<T, S>::size_type n)
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user