| Index: src/vector.h
|
| diff --git a/src/vector.h b/src/vector.h
|
| index a4fdb1060efa195056e5c9c6e7df11065c4e584a..5f4fa5439e82a339f103d239071781b0ddfda44d 100644
|
| --- a/src/vector.h
|
| +++ b/src/vector.h
|
| @@ -32,7 +32,7 @@ class Vector {
|
| // spanning from and including 'from', to but not including 'to'.
|
| Vector<T> SubVector(int from, int to) {
|
| SLOW_DCHECK(to <= length_);
|
| - SLOW_DCHECK(from < to);
|
| + SLOW_DCHECK(from <= to);
|
| DCHECK(0 <= from);
|
| return Vector<T>(start() + from, to - from);
|
| }
|
| @@ -91,10 +91,17 @@ class Vector {
|
| }
|
|
|
| inline Vector<T> operator+(int offset) {
|
| - DCHECK(offset < length_);
|
| + DCHECK(offset <= length_);
|
| return Vector<T>(start_ + offset, length_ - offset);
|
| }
|
|
|
| + inline Vector<T>& operator+=(int offset) {
|
| + DCHECK(offset <= length_);
|
| + start_ += offset;
|
| + length_ -= offset;
|
| + return *this;
|
| + }
|
| +
|
| // Factory method for creating empty vectors.
|
| static Vector<T> empty() { return Vector<T>(NULL, 0); }
|
|
|
|
|