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
This commit is contained in:
Yueh-Hsuan Chiang 2014-12-04 11:41:56 -08:00
parent 97c1940882
commit 1a8f4821a7

View File

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