diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-15 11:50:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-15 11:50:15 +0300 |
commit | 9d58e2b2193015ce974bf6facef6bf0a6d142fdc (patch) | |
tree | de5c70f7c54164949e730f60423317f088093e06 /include | |
parent | 6f49ccc655bdbb1ac53133921555727e697c2b64 (diff) |
fix for ranged loop bounds
Diffstat (limited to 'include')
-rw-r--r-- | include/m_system_cpp.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h index 10acdebde4..8b94e15013 100644 --- a/include/m_system_cpp.h +++ b/include/m_system_cpp.h @@ -203,11 +203,9 @@ template<class T> struct LIST public:
reverse_iterator(const LIST &_lst) :
- index(_lst.getCount()),
+ index(_lst.getCount()-1),
base(_lst.getArray())
{
- if (index > 0)
- index--;
}
class iterator
@@ -222,7 +220,7 @@ template<class T> struct LIST };
__inline iterator begin() const { return iterator(base + index); }
- __inline iterator end() const { return iterator(base); }
+ __inline iterator end() const { return iterator(base-1); }
};
__inline void destroy(void) { List_Destroy((SortedList*)this); }
|