mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Changes to restore sorting functiionality
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35579 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1b1355ff7f
commit
a4140c8f51
11 changed files with 7804 additions and 10611 deletions
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
|
||||
#import "common.h"
|
||||
|
||||
#import "Foundation/NSSortDescriptor.h"
|
||||
|
||||
#import "Foundation/NSCoder.h"
|
||||
|
@ -441,6 +440,8 @@ NSRange range, NSComparator cmptr)
|
|||
GSComparisonTypeComparatorBlock, NULL);
|
||||
}
|
||||
|
||||
#if GS_USE_TIMSORT
|
||||
|
||||
/* These macros make calling the cached IMPs easier,
|
||||
* if we choose to do so later.
|
||||
*/
|
||||
|
@ -508,9 +509,7 @@ _GSTimSort(id *objects,
|
|||
@implementation GSTimSortDescriptor
|
||||
+ (void) load
|
||||
{
|
||||
#ifndef GS_DISABLE_TIMSORT
|
||||
_GSSortStable = _GSTimSort;
|
||||
#endif
|
||||
}
|
||||
|
||||
+ (void) initialize
|
||||
|
@ -1030,8 +1029,8 @@ descriptorOrComparator: (id)descriptorOrComparator
|
|||
// Find an insertion point for the first element in r2 into r1
|
||||
insert = gallopRight(objects[r2.location], objects, r1, 0,
|
||||
sortDescriptorOrComparator, comparisonType, functionContext);
|
||||
r1.location += insert;
|
||||
r1.length -= insert;
|
||||
r1.length = insert - r1.location;
|
||||
r1.location = insert;
|
||||
if (r1.length == 0)
|
||||
{
|
||||
// The entire run r2 lies after r1, just return.
|
||||
|
@ -1081,7 +1080,6 @@ descriptorOrComparator: (id)descriptorOrComparator
|
|||
|
||||
|
||||
@end
|
||||
#ifndef GS_DISABLE_TIMSORT
|
||||
static void
|
||||
_GSTimSort(id *objects,
|
||||
NSRange sortRange,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue