[Scummvm-cvs-logs] CVS: scummvm/saga list.h,1.3,1.4
Andrew Kurushin
h00ligan at users.sourceforge.net
Thu Dec 16 13:31:03 CET 2004
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12226
Modified Files:
list.h
Log Message:
trying remove CRLF
Index: list.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/list.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- list.h 16 Dec 2004 20:49:17 -0000 1.3
+++ list.h 16 Dec 2004 21:30:06 -0000 1.4
@@ -19,24 +19,16 @@
*
*/
-#ifndef SAGA_LIST_H__
-#define SAGA_LIST_H__
-
+#ifndef SAGA_LIST_H__
#define SAGA_LIST_H__
#include "common/list.h"
-
-namespace Saga {
-
+
namespace Saga {
template <class T>
class SortedList : public Common::List<T> {
-public:
- typedef int ( CompareFunction ) (const T& , const T&);
-
+public:
typedef int ( CompareFunction ) (const T& , const T&);
typedef typename Common::List<T>::iterator iterator;
typedef typename Common::List<T>::const_iterator const_iterator;
-
-public:
-
+
public:
iterator pushFront(const T& element) {
return insert(Common::List<T>::begin(), element);
}
@@ -76,9 +68,7 @@
for (iterator i = Common::List<T>::begin(); i != Common::List<T>::end(); ++i) {
res = compareFunction(element, i.operator*());
- if (res < 0) {
- return insert(i, element);
- }
+ if (res < 0) {
return insert(i, element);
}
}
return pushBack(element);
}
@@ -91,11 +81,7 @@
while (i != Common::List<T>::end()) {
res = compareFunction(i.operator*(), pos.operator*());
if (res <= 0) {
-
- T temp(*pos);
- erase(pos);
- ++i;
- return insert(i, temp);
+ T temp(*pos);
erase(pos);
++i;
return insert(i, temp);
}
--i;
}
@@ -110,10 +96,7 @@
while (i != Common::List<T>::end()) {
res = compareFunction(i.operator*(), pos.operator*());
if (res >= 0) {
-
- T temp(*pos);
- erase(pos);
- return insert(i, temp);
+ T temp(*pos);
erase(pos);
return insert(i, temp);
}
++i;
}
@@ -149,6 +132,4 @@
return false;
}
};
-
-} // End of namespace Saga
-#endif
\ No newline at end of file
+} // End of namespace Saga
#endif
\ No newline at end of file
More information about the Scummvm-git-logs
mailing list