File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010( function ( ) {
1111
12- // A stable array sort, because `Array#sort()` is not guaranteed stable.
13- // This is an implementation of merge sort, without recursion.
14-
12+ /**
13+ * A stable array sort, because `Array#sort()` is not guaranteed stable.
14+ * This is an implementation of merge sort, without recursion.
15+ *
16+ * @function Phaser.Utils.Array.StableSort
17+ * @since 3.0.0
18+ *
19+ * @param {array } arr - The input array to be sorted.
20+ * @param {function } comp - The comparison handler.
21+ *
22+ * @return {array } The sorted result.
23+ */
1524var stable = function ( arr , comp ) {
1625 return exec ( arr . slice ( ) , comp ) ;
1726} ;
1827
28+ /**
29+ * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes.
30+ *
31+ * @function Phaser.Utils.Array.StableSort.inplace
32+ * @since 3.0.0
33+ *
34+ * @param {array } arr - The input array.
35+ * @param {function } comp - The comparison handler.
36+ *
37+ * @return {array } The sorted array.
38+ */
1939stable . inplace = function ( arr , comp ) {
2040 var result = exec ( arr , comp ) ;
2141
You can’t perform that action at this time.
0 commit comments