From c1810c8de24cfb05b825f45f24ca7a880dc0a375 Mon Sep 17 00:00:00 2001 From: Andrew Kurushin Date: Thu, 16 Dec 2004 20:49:17 +0000 Subject: reorderUp and reorderDown should return new item position svn-id: r16087 --- saga/list.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'saga') diff --git a/saga/list.h b/saga/list.h index 619060cf2f..397717c55c 100644 --- a/saga/list.h +++ b/saga/list.h @@ -34,7 +34,7 @@ public: typedef typename Common::List::iterator iterator; typedef typename Common::List::const_iterator const_iterator; - + public: iterator pushFront(const T& element) { @@ -83,7 +83,7 @@ public: return pushBack(element); } - void reorderUp(iterator pos, CompareFunction* compareFunction) { + iterator reorderUp(iterator pos, CompareFunction* compareFunction) { iterator i(pos); int res; @@ -94,15 +94,15 @@ public: T temp(*pos); erase(pos); - ++i; - Common::List::insert(i, temp); - return; + ++i; + return insert(i, temp); } --i; } + return pos; } - void reorderDown(iterator pos, CompareFunction* compareFunction) { + iterator reorderDown(iterator pos, CompareFunction* compareFunction) { iterator i(pos); int res; @@ -113,11 +113,11 @@ public: T temp(*pos); erase(pos); - Common::List::insert(i, temp); - return; + return insert(i, temp); } ++i; } + return pos; } iterator eraseAndPrev(iterator pos) { @@ -151,4 +151,4 @@ public: }; } // End of namespace Saga -#endif +#endif \ No newline at end of file -- cgit v1.2.3