From ce08aebde703d81f424c13a6176ffd9e83f4309f Mon Sep 17 00:00:00 2001 From: smatz Date: Sat, 26 Dec 2009 13:49:14 +0000 Subject: (svn r18640) -Fix (r18633): don't assert when accessing first invalid item, it's used quite often in the code -Revert (r18637): it's not needed any more --- src/core/smallvec_type.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 38fa6fe6e..5e4e17365 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -225,7 +225,8 @@ public: */ FORCEINLINE const T *Get(uint index) const { - assert(index < this->items); + /* Allow access to the 'first invalid' item */ + assert(index <= this->items); return &this->data[index]; } @@ -237,7 +238,8 @@ public: */ FORCEINLINE T *Get(uint index) { - assert(index < this->items); + /* Allow access to the 'first invalid' item */ + assert(index <= this->items); return &this->data[index]; } -- cgit v1.2.3-54-g00ecf