Replace exception by assertion in autovector

Summary: Replace exception by assertion in autovector

Test Plan: autovector_test

Reviewers: sdong, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D29847
main
Yueh-Hsuan Chiang 10 years ago
parent 97c1940882
commit 1a8f4821a7
  1. 8
      util/autovector.h

@ -201,16 +201,12 @@ class autovector {
// will check boundry // will check boundry
const_reference at(size_type n) const { const_reference at(size_type n) const {
if (n >= size()) { assert(n < size());
throw std::out_of_range("autovector: index out of range");
}
return (*this)[n]; return (*this)[n];
} }
reference at(size_type n) { reference at(size_type n) {
if (n >= size()) { assert(n < size());
throw std::out_of_range("autovector: index out of range");
}
return (*this)[n]; return (*this)[n];
} }

Loading…
Cancel
Save