diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-07-28 16:02:46 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-07-28 16:02:46 +0000 |
commit | c4454c51bfdf85cc2e019c51717ca3396c097de8 (patch) | |
tree | 6d25732f4a00b672011139d08a3e48650b31fc8b /lib/sbin/Orderer.pl | |
parent | f574ef1853171f7818a87c86f1cdae2365208c97 (diff) |
Amended the sorting algorithm to first remove all routines which need
no sorting.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@806 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/Orderer.pl')
-rw-r--r-- | lib/sbin/Orderer.pl | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/sbin/Orderer.pl b/lib/sbin/Orderer.pl index 3f32bd9d..54a8277b 100644 --- a/lib/sbin/Orderer.pl +++ b/lib/sbin/Orderer.pl @@ -358,10 +358,29 @@ sub SortThings return; } + # Remove anything which doesn't need sorting + $sortcount=0; + $returncount=0; + for ($i=0;$i<scalar(@things);$i++) + { + if ($database{"\U$things[$i] AFTER"} || $database{"\U$things[$i] ALLAFTER"} || + $database{"\U$things[$i] BEFORE"} || $database{"\U$things[$i] ALLBEFORE"}) + { + $sortthings[$sortcount] = $things[$i]; + $sortcount++; + } + else + { + $returnthings[$returncount] = $things[$i]; + $returncount++ + } + } + + # Sort the things - @sorted_things = sort ThingSorter @things; + @sorted_things = sort ThingSorter @sortthings; + return (@returnthings,@sorted_things); - return @sorted_things; } |