Commit Graph

4650 Commits

Author SHA1 Message Date
Dmitri Gribenko
8f7c9ae3fd Collection.sort() => .sorted() 2015-12-18 16:20:01 -08:00
Dmitri Gribenko
7a33fb124c Remove an unsafeBitCast() that is not actually needed 2015-12-18 16:20:01 -08:00
Max Moiseev
514047b6ec removing Collection.split(_ separator: ...) in favor of the one in Sequence 2015-12-18 16:20:01 -08:00
Max Moiseev
30c77a1833 Refactoring Sequence.split family of methods 2015-12-18 16:20:01 -08:00
Dmitri Gribenko
5b728dc859 Remove Range<Index> argument from Collection.partition()
collection.partition(i..<j) => collection[i..<j].partition()
2015-12-18 16:20:01 -08:00
Doug Gregor
2091e7f852 Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words 2015-12-18 10:54:46 -08:00
Doug Gregor
a97ab6dd14 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-18 10:15:47 -08:00
Dmitri Gribenko
6a66b3cff8 Merge pull request #561 from practicalswift/typos-again
[Typo] Replace PR#514-525 with one large PR
2015-12-18 03:37:02 -08:00
Dmitri Gribenko
f436764742 Merge pull request #616 from dduan/removeAll_speedup
[stdlib][performance] skip copying old values during removeAll(keepCapacity: true)
2015-12-17 22:43:22 -08:00
Chris Lattner
3ec6239df3 Merge pull request #549 from zerotypos-found/fix_typo
Fix typo (a --> an, an --> a)
2015-12-17 22:25:22 -08:00
Dmitri Gribenko
ca1f0bf4ad Merge pull request #633 from PatrickPijnappel/patch-2
[stdlib] Remove explicit Equatable implementation for FloatingPointClassification
2015-12-17 21:40:57 -08:00
Max Moiseev
f4aaece75e revisiting CString related String extensions 2015-12-17 17:27:29 -08:00
Dmitri Gribenko
61e2b30975 Merge pull request #615 from PatrickPijnappel/min-max
[stdlib] Refactor min()/max()
2015-12-17 17:14:52 -08:00
Maxim Moiseev
d2be97d856 change return type of String.fromCStringRepairingIllFormedUTF8 2015-12-17 17:08:02 -08:00
Dmitri Gribenko
156d29a2af flatMap(): generic type parameter Intermediate => SegmentOfResult 2015-12-17 17:07:21 -08:00
Dmitri Gribenko
ebb3e45886 Sequence.{min,max}Element() => .min(), .max() 2015-12-17 17:07:01 -08:00
Dmitri Gribenko
9d4d9e8d41 Fix coding style in Stride.swift 2015-12-17 17:06:41 -08:00
Maxim Moiseev
9e50505970 internal or public // @testable initializers 2015-12-17 17:02:49 -08:00
Dmitri Gribenko
b580d55dfb ObjectIdentifier.uintValue => {Int,UInt}.init(_: ObjectIdentifier) 2015-12-17 16:32:11 -08:00
Dmitri Gribenko
6eedc99016 UnicodeDecodingResult: case Result(...) => case ScalarValue(...) 2015-12-17 16:31:49 -08:00
Dmitri Gribenko
a97a0ddf2a StaticString.stringValue => String.init(_:T) 2015-12-17 16:30:55 -08:00
Dmitri Gribenko
4cd48e0f56 public class VaListBuilder => internal class _VaListBuilder 2015-12-17 16:28:39 -08:00
Dmitri Gribenko
fef2d5db60 Remove IOU(Wrapped?) initializer, we prefer to use the implicit conversion instead 2015-12-17 16:28:20 -08:00
Dmitri Gribenko
6b2ad53f80 Remove no-arg initializers from Optional and IOU
We prefer 'nil' to be used instead.
2015-12-17 16:28:08 -08:00
Dmitri Gribenko
11855e40b2 Remove ImplicitlyUnwrappedOptional.{map,flatMap}
It is not possible to call these functions by usual means.
2015-12-17 16:27:23 -08:00
Maxim Moiseev
e7d516e597 String.lowercaseString and .uppercaseString => lowercased and uppercased 2015-12-17 16:26:32 -08:00
Dmitri Gribenko
9096a960ff countStrings() => digits() in docs and tests 2015-12-17 16:25:07 -08:00
Dmitri Gribenko
15a9649062 Repeated(repeating:length:) => repeatElement(_:count:) 2015-12-17 16:24:47 -08:00
Dmitri Gribenko
33bda61fa7 var Repeated.length => let 2015-12-17 16:24:21 -08:00
Dmitri Gribenko
86f1258810 Repeat => Repeated 2015-12-17 16:24:11 -08:00
Patrick Pijnappel
7e96565c1a [stdlib] Remove explicit Equatable implementation for FloatingPointClassification 2015-12-18 11:04:12 +11: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
Patrick Pijnappel
a61839d696 [stdlib] Add ordering guarantee to min() and max() docs 2015-12-18 09:51:34 +11:00
Doug Gregor
f245f18a09 Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words 2015-12-17 11:35:58 -08:00
Max Moiseev
3fe0c60d7f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 11:00:02 -08:00
Max Moiseev
a28a510407 Fixing tests 2015-12-17 10:24:40 -08:00
Chris Lattner
99fcb2dfe1 Change all uses of x = x.successor() to use x._successorInPlace()
...because it is apparently more efficient in some cases.  Technically
we don't do this in ALL places, because it would be unfortunate if
the implementation of _successorInPlace() were self recursive :-)
2015-12-16 22:38:37 -08:00
Daniel Duan
b177c69d6b skip copying old values during removeAll()
As noted in FIXME(performance), calling `.removeAll(keepCapacity: true)` on a
containter of type Dictionay or Set causes a copy of its storage being made.
Only then, it would proceed to delete each element.

This patch makes these hashed collections skip the wasteful copying step.
2015-12-16 22:28:38 -08:00
zerotypos-found
0c1df3577e Fix typo: a --> an, an --> a. 2015-12-17 15:10:25 +09:00
Patrick Pijnappel
fe478b7633 [stdlib] Add sort stability comment to min()/max() 2015-12-17 14:17:50 +11:00
Patrick Pijnappel
75a6609c61 [stdlib] Unabbreviate local variable names 2015-12-17 14:07:58 +11:00
Patrick Pijnappel
370f4f0de4 [stdlib] Refactor min(_:_:_:_:) 2015-12-17 14:00:03 +11:00
Patrick Pijnappel
220f2d1c89 [stdlib] Refactor min(_:_:) 2015-12-17 13:59:48 +11:00
Maxim Moiseev
ee7d55f74b moving unsafeUnwrap into Optional 2015-12-16 17:24:12 -08:00
Maxim Moiseev
c4763ae686 _debugPrecondition => _debugRequire 2015-12-16 17:20:40 -08:00
Maxim Moiseev
e6468a0eca _precondition => _require 2015-12-16 17:19:01 -08:00
Maxim Moiseev
f2f50d6a9d precondition => require 2015-12-16 17:16:08 -08:00
Maxim Moiseev
9d0c912c70 Merging UnsafePointer.deinitializePointee
An optimization should be added in order for the new one to be
efficient, i.e. if the `count` value is equal to `1`, the underlying
`Builtin.destroy` should be called, instead of
`Builtin.destroyArray`.
2015-12-16 17:15:00 -08:00
Maxim Moiseev
38323513ea UnsafePointer.move() => .take() 2015-12-16 17:13:39 -08:00
Maxim Moiseev
e1f304f758 Adding count to initializeMemory
The corresponding test started to fail because of the `_debugPrecodition`
in the implementation of `initializeMemory`.
2015-12-16 17:12:43 -08:00