From 5a0b164c3fa4e0c0dc1d0136740f08b4a1f09219 Mon Sep 17 00:00:00 2001 From: Tom Conkling Date: Fri, 11 Jul 2008 21:40:25 +0000 Subject: [PATCH] These functions aren't actually used by sortDisplayChildren git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@569 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flash/DisplayUtil.as | 38 ---------------------- 1 file changed, 38 deletions(-) diff --git a/src/as/com/threerings/flash/DisplayUtil.as b/src/as/com/threerings/flash/DisplayUtil.as index 0aafbe8c..24f3137b 100644 --- a/src/as/com/threerings/flash/DisplayUtil.as +++ b/src/as/com/threerings/flash/DisplayUtil.as @@ -244,44 +244,6 @@ public class DisplayUtil return dumpHierarchy0(top); } - /** Helper function for sortDisplayChildren. */ - private static function qsortDisplayChildren ( - container :DisplayObjectContainer, left :int, right :int, comp :Function) :void - { - if (right - left > 1) { // containers of size 0 or 1 are already sorted - - // arbitrarily choose the element in the middle of the sort list as the pivot element - var pivotIndex :int = left + ((right - left) / 2); - - pivotIndex = partitionDisplayChildren(container, left, right, pivotIndex, comp); - qsortDisplayChildren(container, left, pivotIndex - 1, comp); - qsortDisplayChildren(container, pivotIndex + 1, right, comp); - } - } - - /** Helper function for qsortDisplayChildren. */ - private static function partitionDisplayChildren ( - container :DisplayObjectContainer, left :int, right :int, pivotIndex :int, comp :Function) :int - { - var pivotObj :DisplayObject = container.getChildAt(pivotIndex); - - container.swapChildrenAt(pivotIndex, right); // move pivot to end - - var storeIndex :int = left; - - for (var i :int = left; i < right; ++i) { - var thisObj :DisplayObject = container.getChildAt(i); - if (0 > comp(thisObj, pivotObj)) { - container.swapChildrenAt(i, storeIndex); - storeIndex += 1; - } - } - - container.swapChildrenAt(storeIndex, right); - - return storeIndex; - } - /** * Internal worker method for findInHierarchy. */