Commit Graph

20 Commits

Author SHA1 Message Date
Dmitri Gribenko
097085e16f stdlib: Sequence.lexicographicalCompare(_:) => .lexicographicallyPrecedes(_:) 2016-02-23 18:12:09 -08:00
Dmitri Gribenko
e81f99d7ea stdlib: Sequence.startsWith() => .starts(with:) 2016-02-23 18:12:09 -08:00
Max Moiseev
52f0cf49b0 [stdlib] indexOf => index(of:)/index(where:) 2016-02-23 11:45:11 -08:00
Dmitri Gribenko
65d840c0ae stdlib: lowercase cases in Optional and ImplicitlyUnwrappedOptional 2016-02-18 00:40:33 -08:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Max Moiseev
a7339e67ac Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-22 11:36:07 -08:00
Chris Lattner
82e5c0c592 Update various tests to stop using ++/-- 2015-12-21 18:07:37 -08:00
Dmitri Gribenko
ebb3e45886 Sequence.{min,max}Element() => .min(), .max() 2015-12-17 17:07:01 -08:00
Dmitri Gribenko
73ce9ae7e9 Collection.count => .length
And other API changes that naturally fall out from this, like
Array(repeating:count:) => Array(repeating:length:).
2015-12-17 15:55:29 -08:00
Max Moiseev
3fe0c60d7f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 11:00:02 -08:00
Dmitri Gribenko
d864cfcf3d Merge pull request #556 from dduan/increment_decrement_search_replace
replace singular statement ++/-- with += 1/-= 1 for integer variables
2015-12-15 17:39:29 -08:00
Max Moiseev
2021dd5a4d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-15 12:49:22 -08:00
Erik Eckstein
0830c36974 [tests] add import statements to prevent unresolved symbols when compiling StdlibUnittest with -sil-serialize-all.
This is the second part of 308f39fe56.
It fixes (better: works-around) linker errors when testing in optimized mode.
2015-12-15 10:46:10 -08:00
Daniel Duan
ebb0c3a204 replaced single-line ++/-- with +=/-= 2015-12-15 09:05:37 -08:00
Dmitri Gribenko
df17ddbc9b init(count: Int, repeatedValue: Element) => init(repeating:count:)
Affected types: _ArrayType, Array, ArraySlice, ContiguousArray, Repeat,
String (initializers from Character and UnicodeScalar)
2015-12-09 17:14:37 -08:00
Dmitri Gribenko
feacbc4433 Rename ErrorType to ErrorProtocol 2015-12-09 17:12:19 -08:00
Joe Groff
0c39db22bc stdlib: Implement strict 'map', 'filter', and 'flatMap' as 'rethrows' operations.
Replace the Lazy-based implementations with open-coded implementations based on the _UnsafePartiallyInitializedContiguousArrayBuffer builder from the previous commit, so that we have control over the early-exit flow when an error interrupts the operation.

Swift SVN r30794
2015-07-30 05:28:34 +00:00
Joe Groff
f62d95dbc8 stdlib: Add 'rethrows' to more SequenceType and CollectionType algorithms.
Including:

- forEach
- split
- Optional flatMap
- minElement
- maxElement
- startsWith
- elementsEqual
- lexicographicalCompare
- contains
- reduce

Still not touching 'map', 'filter', 'flatMap', or 'sort', which need various levels of rearchitecting to fix.

Swift SVN r30792
2015-07-30 05:28:26 +00:00
Joe Groff
ce94497a57 stdlib: Mark short-circuit operators as 'rethrows'.
Swift SVN r30791
2015-07-30 05:28:23 +00:00
Joe Groff
1d49d927e1 stdlib: Mark many higher-order function interfaces as 'rethrows'.
This covers:

- Lifetime-extending wrappers, like withExtendedLifetime, withCString, and withUnsafe*Pointer
- 'map' and friends on Optional
- 'indexOf'

A few APIs I haven't gotten to yet in this first pass:

- Autoclosure APIs, like assert, &&, etc.
- the 'isOrderedBefore' predicate for sorting APIs. The sorting implementation does some microoptimizations with 'inout' closures that violate rethrows checking.
- Strict 'map', 'filter', and friends on CollectionType. These need some plumbing in Lazy to be able to thread a Result-forming transformation through.

This version of the patch updates some protocol customization implementations that I missed the first time around, and includes the tests I forgot to add in the previous iteration.

Swift SVN r30790
2015-07-30 05:28:17 +00:00