Commit Graph

25 Commits

Author SHA1 Message Date
Dave Abrahams
cbcf9aba21 s/LogicValueType/BooleanType/
We're moving toward using that protocol for straight-up Bool types

Swift SVN r19884
2014-07-12 18:58:18 +00:00
Dave Abrahams
6d1095f44e Protocol names end in "Type," "ible," or "able"
Mechanically add "Type" to the end of any protocol names that don't end
in "Type," "ible," or "able."  Also, drop "Type" from the end of any
associated type names, except for those of the *LiteralConvertible
protocols.

There are obvious improvements to make in some of these names, which can
be handled with separate commits.

Fixes <rdar://problem/17165920> Protocols `Integer` etc should get
uglier names.

Swift SVN r19883
2014-07-12 17:29:57 +00:00
Dmitri Hrybenko
12aaf7543b stdlib: remove 'public' from private functions
Swift SVN r19686
2014-07-08 16:47:10 +00:00
Dmitri Hrybenko
977d901643 stdlib: hide quickSort and insertionSort
Finishes rdar://17315534


Swift SVN r19682
2014-07-08 10:33:23 +00:00
Dmitri Hrybenko
8fb09ef13a stdlib: update comments and parameter names for startsWith() algorithm to
clearly reflect semantics

rdar://17567069


Swift SVN r19681
2014-07-08 09:54:10 +00:00
Jordan Rose
da29f099f0 Update stdlib for accessibility modifiers becoming context-sensitive keywords.
Swift SVN r19672
2014-07-08 02:17:46 +00:00
Dave Abrahams
9825954746 [stdlib] That's not a doc comment!
Fixes <rdar://problem/17028678> comments for sort() don't make sense in
the synthesized header.  Putting the right comments in there is
<rdar://problem/17511801> Algorithm.swift needs doc comments

Swift SVN r19370
2014-06-30 21:46:19 +00:00
Dave Abrahams
c1539b3e5d [stdlib] Put the "unsafe" in withUnsafeMutableStorage
This API exposes unmediated access to memory, and most users will never
see the UnsafeArray argument that's passed to the closure, so best to be
explicit.

Swift SVN r19243
2014-06-26 18:22:54 +00:00
Doug Gregor
37df5c430c Update standard library to use [T] array syntax.
Swift SVN r19190
2014-06-25 23:39:20 +00:00
Ted Kremenek
0ce574eb9e Correct mistake where some 'pred' arguments became 'predecessor' instead of 'predicate'.
Thanks to Dmitri and Joe for pointing this out.

Swift SVN r19151
2014-06-24 23:47:00 +00:00
Jordan Rose
cca27d02a0 Tag everything in the standard library with accessibility attributes.
Keep calm: remember that the standard library has many more public exports
than the average target, and that this contains ALL of them at once.
I also deliberately tried to tag nearly every top-level decl, even if that
was just to explicitly mark things @internal, to make sure I didn't miss
something.

This does export more than we might want to, mostly for protocol conformance
reasons, along with our simple-but-limiting typealias rule. I tried to also
mark things private where possible, but it's really going to be up to the
standard library owners to get this right. This is also only validated
against top-level access control; I haven't fully tested against member-level
access control yet, and none of our semantic restrictions are in place.

Along the way I also noticed bits of stdlib cruft; to keep this patch
understandable, I didn't change any of them.

Swift SVN r19145
2014-06-24 21:32:18 +00:00
Ted Kremenek
58558fcca3 Rename 'succ' and 'pred' to 'successor' and 'predecessor' respectively.
This is motivated by <rdar://problem/17051606>.

This ends up renaming variables as well, which seems right for
consistency since we use "predicate" as variable name.

Swift SVN r19135
2014-06-24 19:27:19 +00:00
Chris Lattner
62cad3dce8 add a "..<" operator, which is an alias for ".." and switch the stdlib to use it.
Until I have a chance to update the testsuite, we'll accept both.



Swift SVN r18998
2014-06-19 05:42:29 +00:00
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