Commit Graph

30 Commits

Author SHA1 Message Date
Dmitri Hrybenko
a474641f66 stdlib: protocol extensions: de-underscore reverse()
Swift SVN r28238
2015-05-07 00:30:26 +00:00
Dmitri Hrybenko
270ec3b67c stdlib: protocol extensions: de-underscore reduce()
Swift SVN r28237
2015-05-07 00:30:25 +00:00
Dmitri Hrybenko
035d72d5a7 stdlib: protocol extensions: de-underscore contains()
Swift SVN r28236
2015-05-07 00:30:24 +00:00
Dmitri Hrybenko
822ad74194 stdlib: protocol extensions: de-underscore lexicographicalCompare()
Swift SVN r28235
2015-05-07 00:30:23 +00:00
Dmitri Hrybenko
78d1196f33 stdlib: protocol extensions: de-underscore elementsEqual
Swift SVN r28234
2015-05-07 00:30:22 +00:00
Dmitri Hrybenko
e43ad56a1c stdlib: protocol extensions: de-underscore startsWith()
Swift SVN r28233
2015-05-07 00:30:21 +00:00
Dmitri Hrybenko
62aa1f0e7c stdlib: protocol extensions: de-underscore minElement(), maxElement()
Swift SVN r28232
2015-05-07 00:30:20 +00:00
Dmitri Hrybenko
7e9063a4af stdlib: protocol extensions: de-underscore enumerate()
Swift SVN r28231
2015-05-07 00:30:12 +00:00
Chris Lattner
37f5452d15 require -> guard.
Swift SVN r28223
2015-05-06 22:53:38 +00:00
Doug Gregor
2105aa7394 Remove extraneous 'Self.' from constrained extension where clauses.
NFC; cleans up the standard library implementation slightly.

Swift SVN r28209
2015-05-06 17:05:29 +00:00
Chris Lattner
079e8b982b move stdlib from let/else to require.
Swift SVN r28098
2015-05-03 21:45:06 +00:00
Chris Lattner
31c01eab73 Change the meaning of "if let x = foo()" back to Xcode 6.4 semantics. The compiler
includes a number of QoI things to help people write the correct code.  I will commit
the testcase for it as the next patch.

The bulk of this patch is moving the stdlib, testsuite and validation testsuite to
the new syntax.  I moved a few uses of "as" patterns back to as? expressions in the 
stdlib as well.



Swift SVN r27959
2015-04-30 04:38:13 +00:00
Dmitri Hrybenko
ffc6f62b93 stdlib: doc comments: clarify the behavior of algorithms on SequenceType
These clarifications were requested in API review.

Swift SVN r27951
2015-04-30 00:27:49 +00:00
Dmitri Hrybenko
16ab7b4a3b stdlib: rename equalElements() to elementsEqual() per API review
Swift SVN r27937
2015-04-29 22:34:59 +00:00
Dmitri Hrybenko
70d728efef stdlib: remove the staged API changes for zip()
API review has reached consensus that zip() reads better as a free
function.

Swift SVN r27921
2015-04-29 21:30:02 +00:00
David Farler
9e28dc777a Update standard library doc comments to Markdown
rdar://problem/20180478

Swift SVN r27726
2015-04-26 00:07:11 +00:00
Dmitri Hrybenko
730e6afee0 Revert "stdlib: make map() dynamically dispatched"
This reverts commit r27607.  It broke parse_stdlib_* tests.

Swift SVN r27609
2015-04-22 22:30:45 +00:00
Dmitri Hrybenko
21e5a83631 stdlib: make map() dynamically dispatched
This change tries to recover the performance regression in map() that
was caused by moving map() to a protocol extension and degrading the
static type information (when mapping a collection, we only know that it
is a sequence).  Adding map() to the witness table allows us to provide
a specialized implementation for collections, and hopefully recover the
lost performance.

This is a speculative change, I don't have performance numbers.  I will
watch the performance buildbots and if this change does not help, I'll
revert.

Swift SVN r27607
2015-04-22 22:08:16 +00:00
Dmitri Hrybenko
7a40ec0916 stdlib: simplify code
Swift SVN r27601
2015-04-22 20:42:01 +00:00
Dmitri Hrybenko
701dfbecd2 stdlib: use let-else in maxElement()
Swift SVN r27571
2015-04-22 07:06:40 +00:00
Dmitri Hrybenko
7bbb0071a3 stdlib: fix a bug in SequenceType.startsWith() introduced in r27567
Swift SVN r27569
2015-04-22 07:06:39 +00:00
Chris Lattner
3ec09eec8e force adopt let/else and the Swift 1.2 if/let extensions in the stdlib a bit, for dogfooding
and cleanup.

I changes cases that had a non-trivial "then" body but a trivial else.  Most of the cases in
the stdlib have a trivial "then" clause, so I didn't change them.




Swift SVN r27567
2015-04-22 06:24:06 +00:00
Dmitri Hrybenko
b68fdd2316 stdlib: reword doc comment for SequenceType.flatMap()
Swift SVN r27559
2015-04-22 04:32:41 +00:00
Dmitri Hrybenko
31831c44bb stdlib: change non-API names to be more descriptive
Swift SVN r27558
2015-04-22 04:32:38 +00:00
Dmitri Hrybenko
62403ecc23 stdlib: fix up documentation for new methods
Swift SVN r27510
2015-04-21 00:15:03 +00:00
Dmitri Hrybenko
2bccb13463 stdlib: add an extension point for SequenceType.contains()
This makes the protocol extension as fast as static dispatch for
Set.contains().

Swift SVN r27396
2015-04-17 02:09:59 +00:00
Dmitri Hrybenko
581e853428 stdlib: make filter() a protocol requirement for range replaceable collections
This allows array types to get the best performance.  The default
implementation for range replaceable collections appends elements one by
one, and the optimizer can't hoist uniqueness checks from the loop in
that case yet.

Swift SVN r27314
2015-04-15 05:17:28 +00:00
Dmitri Hrybenko
0af19e7ff3 stdlib: use unsafeBitCast to implement map() and filter() on top of lazy()
Array(other_collection) is using an optimized code path for copying
collections.  An explicit for loop does not.

This commit should recover the performance regression in
rdar://20530390.

Swift SVN r27313
2015-04-15 05:17:27 +00:00
Dmitri Hrybenko
c4b82718d5 stdlib: correct comment
Swift SVN r27312
2015-04-15 05:17:20 +00:00
Dmitri Hrybenko
6e09dad1e6 stdlib: move sequence and collection algorithms to topic-centered files
Swift SVN r27273
2015-04-14 07:03:49 +00:00