Commit Graph

5263 Commits

Author SHA1 Message Date
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
Maxim Moiseev
6c50752aed UnsafePointer: initializeMemory and deinitializePointee 2015-12-16 17:11:57 -08:00
Maxim Moiseev
0e54467bfa Final bulk removal of Type suffix 2015-12-16 17:06:19 -08:00
Maxim Moiseev
2a161bdd62 _ArrayBufferType => _ArrayBufferProtocol 2015-12-16 15:53:40 -08:00
Maxim Moiseev
db84df9eab _ArrayType => _ArrayProtocol 2015-12-16 15:53:27 -08:00
Maxim Moiseev
ca932fca5a CVarArgType => CVarArg 2015-12-16 15:52:01 -08:00
Dmitri Gribenko
3d0ad16094 Unsafe[Mutable]Pointer.memory => .pointee 2015-12-16 15:50:31 -08:00
Dmitri Gribenko
f1dbe205a3 UnsafeMutablePointer.dealloc(_:) => .deallocateCapacity(_:) 2015-12-16 15:47:58 -08:00
Dmitri Gribenko
1f70e25899 UnsafeMutablePointer.alloc(_:) => UnsafeMutablePointer(allocatingCapacity:) 2015-12-16 15:45:48 -08:00
Dmitri Gribenko
4e8291fcfb Coding style fixes 2015-12-16 15:30:56 -08:00
Max Moiseev
fca25fbeb9 Comment improvements and test fixes 2015-12-16 15:29:52 -08:00
Patrick Pijnappel
58bc25bed6 [stdlib] Add comment 2015-12-17 10:15:45 +11:00
Patrick Pijnappel
8d1261ed22 [stdlib] Fix Int(_:radix:) accepting unintentional cases (SR-187) 2015-12-17 10:12:36 +11:00
Dmitri Gribenko
339c7a99dc Remove no-argument initializers from unsafe pointer types
The preferred way to create a nil pointer is to use the 'nil' literal.

Affected types:
AutoreleasingUnsafeMutablePointer
OpaquePointer
UnsafeMutablePointer
UnsafePointer
2015-12-16 14:59:50 -08:00
Patrick Pijnappel
0998e38ef4 [stdlib] Fix internal doc comment 2015-12-17 09:57:53 +11:00
Dmitri Gribenko
8e5686d563 Fix coding style 2015-12-16 14:55:09 -08:00
Dmitri Gribenko
152ef15f83 Improve comments on unsafe pointers 2015-12-16 14:54:57 -08:00
Dmitri Gribenko
63cbe16b68 Rename Memory to Pointee in generic parameter names
UnsafePointer<Memory> => UnsafePointer<Pointee>
UnsafeMutablePointer<Memory> => UnsafeMutablePointer<Pointee>
AutoreleasingUnsafeMutablePointer<Memory> =>
  AutoreleasingUnsafeMutablePointer<Pointee>
2015-12-16 14:54:36 -08:00
Dmitri Gribenko
27b421729e Coding style fix 2015-12-16 14:50:48 -08:00
Dmitri Gribenko
4025882438 Improve comments 2015-12-16 14:50:35 -08:00
Dmitri Gribenko
91675e065b IteratorOfOne => IteratorOverOne 2015-12-16 14:50:22 -08:00
Dmitri Gribenko
7971a67ee0 Remove Bit 2015-12-16 14:46:26 -08:00
Maxim Moiseev
c1d0358030 _PointerType => _Pointer 2015-12-16 14:45:57 -08:00
Maxim Moiseev
62c85d379d OutputStreamType => OutputStream 2015-12-16 14:45:38 -08:00
Maxim Moiseev
0a6a03df47 IntervalType => Interval 2015-12-16 14:44:17 -08:00
Maxim Moiseev
a072007dfe ReverseIndexType => ReverseIndexProtocol 2015-12-16 14:38:06 -08:00
practicalswift
8ab8847684 Fix typos. 2015-12-16 22:09:32 +01:00
Arsen Gasparyan
9f728c6dbd [stdlib] Make comparison operator choices consistent 2015-12-16 22:50:36 +03:00