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:
parent
97c1940882
commit
1a8f4821a7
@ -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];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user