From bec09d30945c7dc143dc4ccd5e2fba1dcaccaac1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 4 Apr 2006 23:55:47 +0000 Subject: 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 --- backends/fs/fs.cpp | 15 --------------- backends/fs/fs.h | 7 +++---- 2 files changed, 3 insertions(+), 19 deletions(-) (limited to 'backends/fs') 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 { -public: - void sort(); -}; +class FSList : public Common::Array {}; /** -- cgit v1.2.3