From 9d58e2b2193015ce974bf6facef6bf0a6d142fdc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Mar 2018 11:50:04 +0300 Subject: fix for ranged loop bounds --- include/m_system_cpp.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/m_system_cpp.h') 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 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 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); } -- cgit v1.2.3