summaryrefslogtreecommitdiff
path: root/src/core/smallvec_type.hpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-12-26 13:49:14 +0000
committersmatz <smatz@openttd.org>2009-12-26 13:49:14 +0000
commitce08aebde703d81f424c13a6176ffd9e83f4309f (patch)
treea196b69ce043ed26e7c6ea6fe0d6988391358932 /src/core/smallvec_type.hpp
parent9574371e53aec0d25cbb50d52b1bd0cb8ff8c379 (diff)
downloadopenttd-ce08aebde703d81f424c13a6176ffd9e83f4309f.tar.xz
(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
Diffstat (limited to 'src/core/smallvec_type.hpp')
-rw-r--r--src/core/smallvec_type.hpp6
1 files changed, 4 insertions, 2 deletions
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];
}