Logo

Programming-Idioms

History of Idiom 100 > diff from v57 to v58

Edit summary for version 58 by OC:
New Obj-C implementation by user [OC]

Version 57

2020-05-03, 21:26:29

Version 58

2020-10-10, 23:04:04

Idiom #100 Sort by a comparator

Sort elements of array-like collection items, using a comparator c.

Idiom #100 Sort by a comparator

Sort elements of array-like collection items, using a comparator c.

Variables
items,c
Variables
items,c
Extra Keywords
list
Extra Keywords
list
Imports
@import Foundation;
Code
[items sortUsingComparator:c];
Comments bubble
Sorts in-place; for creation of a new sorted array leaving the receiver unchanged there's sortedArrayUsingComparator: