ObjFW  Diff

Differences From Artifact [0f6bd8fd60]:

To Artifact [38e99ca8e4]:


88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
		left = i + 1;
	}
}

#ifdef OF_HAVE_BLOCKS
static void
quicksortWithBlock(OFMutableArray *array, size_t left, size_t right,
    of_comparator_t comparator, int options)
{
	OFComparisonResult ascending, descending;

	if (options & OF_ARRAY_SORT_DESCENDING) {
		ascending = OFOrderedDescending;
		descending = OFOrderedAscending;
	} else {







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
		left = i + 1;
	}
}

#ifdef OF_HAVE_BLOCKS
static void
quicksortWithBlock(OFMutableArray *array, size_t left, size_t right,
    OFComparator comparator, int options)
{
	OFComparisonResult ascending, descending;

	if (options & OF_ARRAY_SORT_DESCENDING) {
		ascending = OFOrderedDescending;
		descending = OFOrderedAscending;
	} else {
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
	if (count == 0 || count == 1)
		return;

	quicksort(self, 0, count - 1, selector, options);
}

#ifdef OF_HAVE_BLOCKS
- (void)sortUsingComparator: (of_comparator_t)comparator options: (int)options
{
	size_t count = self.count;

	if (count == 0 || count == 1)
		return;

	quicksortWithBlock(self, 0, count - 1, comparator, options);







|







423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
	if (count == 0 || count == 1)
		return;

	quicksort(self, 0, count - 1, selector, options);
}

#ifdef OF_HAVE_BLOCKS
- (void)sortUsingComparator: (OFComparator)comparator options: (int)options
{
	size_t count = self.count;

	if (count == 0 || count == 1)
		return;

	quicksortWithBlock(self, 0, count - 1, comparator, options);