Commit Graph

12 Commits

Author SHA1 Message Date
Dave Abrahams
c5c17e2615 [stdlib] Sort Arrays using bulk mutation backdoor
This results in a a massive speedup and could in principle be applied to
other bulk array mutations.

Swift SVN r18926
2014-06-16 14:04:54 +00:00
Dave Abrahams
acc2c3be40 [stdlib] Prepare array sort for value semantics
Sorting was a bit of a mess; we had sort functions doing in-place
mutation /and/ returing the value, and people were confused by the
asymmetry of Array's sort() method with other higher-level methods.

Fixes <rdar://problem/17185815> sort([]T, f) mutates the original array
<rdar://problem/17225190> The Array.sort() method should return a sorted array

Swift SVN r18922
2014-06-16 13:48:43 +00:00
Manman Ren
e3517e8792 [stdlib] add two-operand version of min.
This corresponds to the change on max at r18767.


Swift SVN r18769
2014-06-10 00:57:08 +00:00
Manman Ren
4c284e48bd [stdlib] add two-operand version of max.
This helps array append's performance by ~ 2x. The generic max with a variadic
argument takes at least 3 arguments, it creates a temporary array then iterates
over the array.

This is an updated version of r18764.
rdar://17140639 rdar://17073827


Swift SVN r18767
2014-06-10 00:33:46 +00:00
Manman Ren
aec78d0693 [stdlib] revert r18764.
Swift SVN r18765
2014-06-10 00:13:41 +00:00
Manman Ren
cc90c81239 [stdlib] add two-operand version of max and use max2 in stdlib when appropriate.
This helps array append's performance by ~ 2x. The generic max with a variadic
argument creates a temporary array then iterates over the array.

rdar://17140639 rdar://17073827


Swift SVN r18764
2014-06-09 23:56:40 +00:00
Nadav Rotem
04b17cc63f Add comments. NFC.
Swift SVN r18637
2014-05-26 19:52:01 +00:00
Nadav Rotem
1c3c12fd5e Fix a bug in the partition() method that is used by sort.
The problem was that we were swapping the pivot while partitioning the array.

Thanks Dave!



Swift SVN r18611
2014-05-24 01:24:34 +00:00
Dmitri Hrybenko
a4d9dcf1a7 stdlib: extinguish \brief and \c
Swift SVN r18261
2014-05-17 18:10:51 +00:00
Ted Kremenek
9eea282719 Switch range operators ".." and "...".
- 1..3 now means 1,2
- 1...3 now means 1,2,3

Implements <rdar://problem/16839891>

Swift SVN r18066
2014-05-14 07:36:00 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Dmitri Hrybenko
29cebdf797 Splitting the standard library: step 1: move stdlib -> stdlib/core
Swift SVN r5864
2013-06-28 02:31:01 +00:00