aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
authorMax Horn2006-04-04 23:55:47 +0000
committerMax Horn2006-04-04 23:55:47 +0000
commitbec09d30945c7dc143dc4ccd5e2fba1dcaccaac1 (patch)
treeae23245d53ee0b48082405b7d9409854423a3610 /backends/fs
parent66d8b85463da60f0b88c3f7d6068df502d940546 (diff)
downloadscummvm-rg350-bec09d30945c7dc143dc4ccd5e2fba1dcaccaac1.tar.gz
scummvm-rg350-bec09d30945c7dc143dc4ccd5e2fba1dcaccaac1.tar.bz2
scummvm-rg350-bec09d30945c7dc143dc4ccd5e2fba1dcaccaac1.zip
Turned FSList::sort into a generic function which can be applied to anything which implements comparable iterators (like Array, List, or plain C arrays)
svn-id: r21617
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/fs.cpp15
-rw-r--r--backends/fs/fs.h7
2 files changed, 3 insertions, 19 deletions
diff --git a/backends/fs/fs.cpp b/backends/fs/fs.cpp
index 4cc0432638..ecb8f50aab 100644
--- a/backends/fs/fs.cpp
+++ b/backends/fs/fs.cpp
@@ -24,21 +24,6 @@
#include "backends/fs/fs.h"
#include "common/util.h"
-void FSList::sort() {
- // Simple selection sort
- for (iterator i = begin(); i != end(); ++i) {
- iterator m(i);
- iterator j(i);
- ++j;
- for (; j != end(); ++j)
- if (*j < *m)
- m = j;
- if (m != i)
- SWAP(*m, *i);
- }
-}
-
-
FilesystemNode AbstractFilesystemNode::wrap(AbstractFilesystemNode *node) {
FilesystemNode wrapper(node);
return wrapper;
diff --git a/backends/fs/fs.h b/backends/fs/fs.h
index 7005707b16..27f8c7679f 100644
--- a/backends/fs/fs.h
+++ b/backends/fs/fs.h
@@ -60,11 +60,10 @@ class FilesystemNode;
/**
* List of multiple file system nodes. E.g. the contents of a given directory.
+ * This is subclass instead of just a typedef so that we can use forward
+ * declarations of it in other places.
*/
-class FSList : public Common::Array<FilesystemNode> {
-public:
- void sort();
-};
+class FSList : public Common::Array<FilesystemNode> {};
/**