Skip to content

Applying API guidelines to The Standard Library #1607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 353 commits into from
Mar 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
353 commits
Select commit Hold shift + click to select a range
fc65e67
fixing validation tests
Nov 10, 2015
ee7d55f
moving `unsafeUnwrap` into `Optional`
Nov 10, 2015
a28a510
Fixing tests
Dec 17, 2015
3fe0c60
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Dec 17, 2015
f245f18
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swi…
DougGregor Dec 17, 2015
3969ed2
Clang importer: use lookup table version number in the module file ex…
DougGregor Dec 17, 2015
9f09934
fixing tests after merge
Dec 17, 2015
fa9792b
Omit needless words: fix 1_stdlib/NSObject.swift test to use remapped…
DougGregor Dec 17, 2015
824088a
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
DougGregor Dec 17, 2015
73ce9ae
Collection.count => .length
gribozavr Nov 10, 2015
86f1258
Repeat => Repeated
gribozavr Nov 10, 2015
33bda61
var Repeated.length => let
gribozavr Nov 10, 2015
15a9649
Repeated(repeating:length:) => repeatElement(_:count:)
gribozavr Nov 10, 2015
9096a96
countStrings() => digits() in docs and tests
gribozavr Nov 10, 2015
e7d516e
String.lowercaseString and .uppercaseString => lowercased and uppercased
Nov 10, 2015
9d87555
fixing validation tests
Nov 11, 2015
11855e4
Remove ImplicitlyUnwrappedOptional.{map,flatMap}
gribozavr Nov 10, 2015
6b2ad53
Remove no-arg initializers from Optional and IOU
gribozavr Nov 11, 2015
fef2d5d
Remove IOU(Wrapped?) initializer, we prefer to use the implicit conve…
gribozavr Nov 11, 2015
4cd48e0
public class VaListBuilder => internal class _VaListBuilder
gribozavr Nov 11, 2015
a97a0dd
StaticString.stringValue => String.init(_:T)
gribozavr Nov 11, 2015
6eedc99
UnicodeDecodingResult: case Result(...) => case ScalarValue(...)
gribozavr Nov 11, 2015
b580d55
ObjectIdentifier.uintValue => {Int,UInt}.init(_: ObjectIdentifier)
gribozavr Nov 11, 2015
9e50505
internal or public // @testable initializers
Nov 11, 2015
9d4d9e8
Fix coding style in Stride.swift
gribozavr Nov 12, 2015
ebb3e45
Sequence.{min,max}Element() => .min(), .max()
gribozavr Nov 13, 2015
156d29a
flatMap(): generic type parameter `Intermediate` => `SegmentOfResult`
gribozavr Nov 13, 2015
d2be97d
change return type of String.fromCStringRepairingIllFormedUTF8
Nov 10, 2015
f4aaece
revisiting CString related String extensions
Nov 13, 2015
a97ab6d
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
DougGregor Dec 18, 2015
49fc823
[SIL] Add test case for crash triggered in swift::Parser::parseSILVTa…
practicalswift Dec 17, 2015
fa76f20
Annotate new tests for the --no-assertions build
gribozavr Dec 17, 2015
8f56c2a
Fix 80-column violations.
rudkx Dec 17, 2015
564ea39
Replace tabs with spaces.
rudkx Dec 17, 2015
9607883
fixing tests after merge
Dec 17, 2015
5b89565
Annotate SIL crash tests for the --no-assertions build
gribozavr Dec 17, 2015
45bec1b
Remove 'REQUIRES: asserts' from fixed crash tests: they don't crash a…
gribozavr Dec 17, 2015
b44a5be
Extract method to run all function passes over a given function.
rudkx Dec 17, 2015
b365e27
Add frontend option -debug-time-compilation.
jrose-apple Dec 17, 2015
fe95ac6
Fix another -Wpessimizing-move issue.
jrose-apple Dec 17, 2015
6468863
Clang importer: factor out "should this declaration be imported?". NFC
DougGregor Dec 17, 2015
1614487
Clang importer: use proper Clang context when omitting needless words.
DougGregor Dec 17, 2015
2091e7f
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swi…
DougGregor Dec 18, 2015
e05ca05
Omit needless words requires the use of Swift name lookup tables.
DougGregor Dec 18, 2015
cd1c106
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
DougGregor Dec 18, 2015
eb90d97
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swi…
DougGregor Dec 18, 2015
eefada1
Merge pull request #648 from apple/swift-3-omit-needless-words
DougGregor Dec 18, 2015
5b728dc
Remove Range<Index> argument from Collection.partition()
gribozavr Nov 13, 2015
f19fc92
using `expectUnreachable` instead of `expectTrue(false, "")`
Nov 13, 2015
30c77a1
Refactoring `Sequence.split` family of methods
Nov 13, 2015
514047b
removing Collection.split(_ separator: ...) in favor of the one in Se…
Nov 13, 2015
7a33fb1
Remove an unsafeBitCast() that is not actually needed
gribozavr Nov 15, 2015
8f7c9ae
Collection.sort() => .sorted()
gribozavr Nov 14, 2015
7737688
Collection.sortInPlace() => .sort()
gribozavr Nov 16, 2015
5498aa1
`stride(to:by:)` => `strideTo(_:by:)`
gribozavr Nov 16, 2015
ddd45f5
Revert "removing Collection.split(_ separator: ...) in favor of the o…
Nov 16, 2015
497b348
turning UnicodeScalar.isASCII etc into properties
Nov 17, 2015
e175a84
Unmanaged<T>.toOpaque() => OpaquePointer.init<T>()
Nov 18, 2015
5037182
reverse() => reversed()
Nov 18, 2015
bbfcab8
func isEmptyInput => var isEmptyInput {get}
Nov 18, 2015
3ab767a
func superclassMirror() => var superclassMirror {get}
Nov 18, 2015
117b653
func customMirror() => var
gribozavr Nov 19, 2015
47d48e4
func customPlaygroundQuickLook() => var
gribozavr Nov 19, 2015
2245f75
func _unsafeUnwrap() => var _unsafelyUnwrapped
gribozavr Nov 20, 2015
f6c00e8
String: var lowercased, uppercased => func
gribozavr Nov 20, 2015
d72932e
Replace Unmanaged with UnsafeReference
Nov 20, 2015
b3fcc5f
underestimateLength() => underestimatedLength()
Nov 19, 2015
5ccc258
func underestimatedLength() => var underestimatedLength { get }
Nov 20, 2015
0657727
var Sequence.enumerated => func
gribozavr Nov 21, 2015
e7b2666
Set: maybeSuperset => possibleSuperset in argument labels
gribozavr Nov 21, 2015
c07056d
Mirrors: T => Subject
gribozavr Nov 21, 2015
1e26d22
IteratorOverOne.init(_:) => internal
gribozavr Nov 21, 2015
7e375df
startsWith(): other => possiblePrefix
gribozavr Nov 22, 2015
bc94209
cleaning up initializePointee/deinitializePointee, error messages and…
Nov 30, 2015
b227793
Fixing tests
Dec 19, 2015
2f7b64e
Merge remote-tracking branch 'origin' into swift-3-api-guidelines
Dec 21, 2015
547b650
Fixing the build after merge
Dec 22, 2015
51865a1
_debugRequire => _stdlibAssert etc.
Dec 3, 2015
a7339e6
Merge remote-tracking branch 'origin' into swift-3-api-guidelines
Dec 22, 2015
200be71
Merge remote-tracking branch 'origin' into swift-3-api-guidelines
Dec 23, 2015
9391b0a
Reverting fixits-apply.swift changes applied on merge
Dec 23, 2015
f51e708
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Jan 4, 2016
1a38e0a
Merge branch 'master' into swift-3-api-guidelines
DougGregor Jan 6, 2016
8674f9d
[Clang importer] Enable inference of default arguments by default
DougGregor Jan 7, 2016
08e1e4a
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Jan 12, 2016
74ce1ca
Add unavailable declarations for Swift 2.2 -> 3 migration
gribozavr Jan 19, 2016
7d70b70
Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-…
DougGregor Jan 20, 2016
86680ec
[stdlib] @available attributes for removed APIs
Jan 20, 2016
9a018bd
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Jan 20, 2016
1852e25
Fix test 'test/SILOptimizer/side-effect.sil'
gribozavr Jan 20, 2016
c9a6dca
fixing mention of FloatingPointType in tests
Jan 21, 2016
a244465
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swi…
Jan 21, 2016
7c35559
fixing tests
Jan 21, 2016
b4d7483
improving the deprecation attribute message for MutableSliceable
Jan 21, 2016
a34a44f
Swift 3 migration: add migration aids for EnumerateSequence
gribozavr Jan 21, 2016
62f73f4
Rename CollectionDefaultIterator to IndexingIterator
gribozavr Jan 21, 2016
e3bb2a0
[stdlib] adding init(repeating:length:) to RangeReplaceableCollection
Jan 21, 2016
744b989
[stdlib] optimization for RangeReplaceableCollection.appendContentsOf
Jan 21, 2016
5568426
[stdlib] RangeReplaceable.init with 0 repeated elements optimization
Jan 21, 2016
d00f407
[stdlib] checking for negative count value in Repeated.init
Jan 21, 2016
70d346c
[stdlib] test for negative count in RangeReplaceableCollection.init
Jan 21, 2016
c5d694c
Swift 3 migration: add migration aids for EnumeratedIterator and Enum…
gribozavr Jan 21, 2016
b371422
stdlib: standardize fatalError() messages for unavailable APIs
gribozavr Jan 21, 2016
574052f
stdlib: standardize fatalError() messages for unavailable APIs
gribozavr Jan 22, 2016
f515357
stdlib: rename count labels in underscored protocols
gribozavr Jan 22, 2016
3b4248e
stdlib: add migration aids for lazy filter collections
gribozavr Jan 22, 2016
ed790c8
Swift 3 migration: add annotations for MirrorPathType
gribozavr Jan 22, 2016
29b26cf
[stdlib] making Set conform to SetAlgebra
Jan 22, 2016
9bcd5a1
Collection.length => .count
gribozavr Jan 23, 2016
fa5e4c7
stdlib comments: remove duplicated punctuation
gribozavr Jan 23, 2016
59303e2
[stdlib] improving RangeReplaceableCollection
Jan 27, 2016
61c8372
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Feb 5, 2016
bc68487
Commenting out 'strip NS prefix' functionality for now
Feb 5, 2016
39fdbca
making Swift build succesfully after the merge
Feb 5, 2016
55fde4c
making tests pass
Feb 6, 2016
3a39848
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Feb 15, 2016
a558d13
Revert "Replace Unmanaged with UnsafeReference"
Feb 16, 2016
efaa39e
stdlib: add first argument labels and some other changes to conform t…
gribozavr Feb 13, 2016
40a31f2
stdlib: fix coding style
gribozavr Feb 13, 2016
bf34b04
stdlib: lowercase cases of FloatingPointClassification enum
gribozavr Feb 13, 2016
25cc2d5
stdlib: add first argument labels to Set and Dictionary
gribozavr Feb 15, 2016
624461f
wip
gribozavr Feb 16, 2016
0e1c488
stdlib: print, debugPrint: 'toStream:' => 'to:'
gribozavr Feb 16, 2016
dd75aed
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
gribozavr Feb 17, 2016
80fa72a
stdlib: fix coding style
gribozavr Feb 17, 2016
65d840c
stdlib: lowercase cases in Optional and ImplicitlyUnwrappedOptional
gribozavr Feb 18, 2016
0f36bec
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
gribozavr Feb 19, 2016
593b4cc
stdlib: add first argument label to _failEarlyRangeCheck2()
gribozavr Feb 19, 2016
f912c8f
stdlib: readLine(stripNewline:) => readLine(strippingNewline:)
gribozavr Feb 19, 2016
52981e8
stdlib: remove redundant initializers for HalfOpenInterval and Closed…
gribozavr Feb 19, 2016
325bc5a
Fix ClangModules/attr-swift_private.swift
gribozavr Feb 19, 2016
6c64dcf
stdlib: lowercase enum cases in _JoinIteratorState
gribozavr Feb 19, 2016
98561f6
stdlib: joinWithSeparator(_:) => join(separator:)
gribozavr Feb 19, 2016
9293c1f
stdlib: fix coding style
gribozavr Feb 19, 2016
f39b443
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
gribozavr Feb 19, 2016
b90470e
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
gribozavr Feb 19, 2016
08229b2
stdlib: fix coding style
gribozavr Feb 19, 2016
f64f0be
stdlib: ManagedBuffer.create(_:) => .create(minimumCapacity:)
gribozavr Feb 19, 2016
380a13e
stdlib: lowercase cases of the _DefaultDescendantRepresentation enum
gribozavr Feb 19, 2016
b1ef18f
stdlib: lowercase cases of AncestorRepresentation and DisplayStyle enums
gribozavr Feb 20, 2016
40b1a0b
[stdlib] all sorts of require renamed back to precondition
Feb 20, 2016
78ba5d5
[stdlib] Requires in comments changed to Precondition
Feb 20, 2016
63481be
stdlib: lowercase cases of the PlaygroundQuickLook enum
gribozavr Feb 20, 2016
2c14a00
stdlib: add labels to DictionaryLiteral.Element tuple
gribozavr Feb 20, 2016
51ce68c
Fix benchmarks after Optional.None => .none rename
gribozavr Feb 20, 2016
9968dee
stdlib: remove dead code
gribozavr Feb 20, 2016
a6696ef
stdlib: lowercase option set names in a comment
gribozavr Feb 20, 2016
a5bdf9b
stdlib: Optional._unsafelyUnwrapped => ._unsafelyUnwrappedUnchecked
gribozavr Feb 20, 2016
3d3d454
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
gribozavr Feb 20, 2016
f27315b
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
gribozavr Feb 20, 2016
675f457
Introducing `by` argument label to `Sequence.split`
Feb 22, 2016
fcad164
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Feb 22, 2016
481bcab
[stdlib] API naming guidelines applied to `split` and `join`
Feb 22, 2016
4b9eab6
`appendContentsOf` => `appendContents(of:)`
Feb 23, 2016
8c3fbc5
stdlib: rename Optional and IUO intrinsics
gribozavr Feb 23, 2016
e2f5e05
stdlib: Streamable.writeTo() => .write(to:)
gribozavr Feb 23, 2016
82998a1
stdlib: _TeeStream: unlock streams in the order opposite to locking o…
gribozavr Feb 23, 2016
3085c49
stdlib: add argument labels to _didEnterMain
gribozavr Feb 23, 2016
196188b
stdlib: add 'to:' label to dump()
gribozavr Feb 23, 2016
642fb40
build-script: let distcc dictate parallelism
Feb 23, 2016
9bf2a86
[stdlib] Fix API renaming build failures
Feb 23, 2016
7e7da9e
Revert "[stdlib] Fix API renaming build failures"
Feb 23, 2016
db4e802
[gardening] Remove tab characters.
Feb 23, 2016
ad2a309
Revert "Revert "[stdlib] Fix API renaming build failures""
Feb 23, 2016
86d1629
[gardening] Remove tab characters.
Feb 23, 2016
ecde5aa
[api-rename] Fix tests to use new APIs.
Feb 23, 2016
52f0cf4
[stdlib] indexOf => index(of:)/index(where:)
Feb 23, 2016
acd97e3
Improve a doc comment
Feb 23, 2016
158adab
stdlib: Add 'invoke:' label to withVaList
Feb 23, 2016
577bb74
stdlib: fix renaming mistake
Feb 23, 2016
f0633ce
stdlib: Sequence.iterator() => .makeIterator()
gribozavr Feb 23, 2016
ffeec94
stdlib: fix coding style
gribozavr Feb 23, 2016
0b759a4
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Feb 23, 2016
85766f8
[stdlib] availability attributes for indexOf
Feb 23, 2016
423b6ab
stdlib: Revert "UnsafePointer.move() => .take()"
Feb 23, 2016
42d5f30
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swi…
Feb 23, 2016
3aa7fc1
[api-renaming] XFAIL this test on iOS platforms
Feb 23, 2016
e62bd68
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swi…
Feb 23, 2016
d96b051
stdlib: initializePointee(_) => initialize(with:)
Feb 23, 2016
1998aee
[api-renaming] XFAIL this test on iOS platforms
Feb 23, 2016
64a5165
stdlib: deinitializePointee(_) => deinitialize()
Feb 23, 2016
ece8778
stdlib: merge swift 3 UnsafePointer migrations
Feb 23, 2016
bd6d717
Merge pull request #1414 from apple/mish-swift-3
gribozavr Feb 23, 2016
e207ae3
[stdlib] availability attributes in CString
Feb 23, 2016
a7c1df8
[stdlib] fixing the unavailable function declaration
Feb 24, 2016
40d5e34
stdlib: insertContentsOf(_:at:) becomes insertContents(of:at:)
jrose-apple Feb 24, 2016
416b25b
stdlib: unsafeAddressOf(_:) becomes unsafeAddress(of:)
jrose-apple Feb 24, 2016
0205191
stdlib: SequenceType._initializeTo(_:) becomes _copyContents(initiali…
jrose-apple Feb 24, 2016
6f0a1ad
stdlib: Update NSStringAPI.swift to match NSString under Swift 3 nami…
cwillmor Feb 24, 2016
27e8f72
Merge pull request #1420 from cwillmor/swift-3-api-guidelines
gribozavr Feb 24, 2016
e81f99d
stdlib: Sequence.startsWith() => .starts(with:)
gribozavr Feb 24, 2016
097085e
stdlib: Sequence.lexicographicalCompare(_:) => .lexicographicallyPrec…
gribozavr Feb 24, 2016
e9212d4
stdlib: Unavailable decls for renamed NSStringAPI methods
cwillmor Feb 24, 2016
d187835
Merge pull request #1423 from cwillmor/swift-3-api-guidelines
gribozavr Feb 24, 2016
391d1c3
Adjust SceneKit test for String API changes
gribozavr Feb 24, 2016
fb1ed8e
stdlib: rename _uninitializedCopy to _copyContents
gribozavr Feb 24, 2016
d7e8251
stdlib: add argument labels to sort() implementation details
gribozavr Feb 24, 2016
f9f618b
[stdlib] adding 'invoke' label to StaticString.withUTF8Buffer
Feb 24, 2016
0490e86
[stdlib] strideTo/strideThrough => stride(to:...)/stride(through:...)
Feb 24, 2016
12574d0
stdlib: Mark old insertContentsOf(_:at:) and unsafeAddressOf(_:) unav…
jrose-apple Feb 24, 2016
24218e0
Fix build failure after String API changes
gribozavr Feb 24, 2016
8fa5bb1
stdlib: fix coding style
gribozavr Feb 24, 2016
18965b3
stdlib: add argument labels to _cocoaStringToContiguous()
gribozavr Feb 24, 2016
c2c714b
stdlib: add argument labels in _StringBufferIVars
gribozavr Feb 24, 2016
bb3eaaf
Merging in latest master
Feb 24, 2016
2ddb610
stdlib: Audit API for Swift 3 preposition, first-arg label rules
cwillmor Feb 24, 2016
1731ed2
Merge pull request #1439 from cwillmor/swift-3-api-guidelines
gribozavr Feb 25, 2016
f338927
stdlib: String indices: samePositionIn(_:) => samePosition(in:)
gribozavr Feb 25, 2016
a5e2e41
stdlib: Add missing separator label that escaped previous audit.
cwillmor Feb 25, 2016
c305ea0
stdlib: Audit StringUTF16.swift, StringUTF8.swift for Swift 3 naming.
cwillmor Feb 25, 2016
81905be
Rename _BridgedNSError._NSErrorDomain to _nsErrorDomain.
jrose-apple Feb 25, 2016
b71f744
stdlib: Rename cases in XCTest._XCTThrowableBlockResult.
jrose-apple Feb 25, 2016
1a5f23e
stdlib: Adjust names of hand-imported NSCocoaError/NSURLError cases.
jrose-apple Feb 25, 2016
979e4a8
stdlib: Rename {Float,Double.CGFloat}.NaN to 'nan'
jrose-apple Feb 25, 2016
e45dfe0
stdlib: Rename 'Native'/'Cocoa' representations inside Dictionary/Set.
jrose-apple Feb 25, 2016
e5ae60a
stdlib: Rename some helpers inside UnicodeTrie. NFC.
jrose-apple Feb 25, 2016
8fdee4a
stdlib: Rename some implementation details of mirrors/reflection.
jrose-apple Feb 25, 2016
f922084
stdlib: Rename miscellaneous enum cases and static vars.
jrose-apple Feb 25, 2016
e4e9c71
StdlibUnittest: Rename enum cases and static vars to match API guidel…
jrose-apple Feb 25, 2016
5cffdee
Merge pull request #1440 from cwillmor/swift-3-api-guidelines
gribozavr Feb 25, 2016
9a0c50b
stdlib: add argument labels in _StringBufferIVars
gribozavr Feb 24, 2016
7b3e9c3
stdlib: fix coding style
gribozavr Feb 24, 2016
68bf4ae
stdlib: apply API guidelines in Unicode.swift
gribozavr Feb 25, 2016
3c93ccc
stdlib: apply API guidelines and fix coding style in SwiftNativeNSArr…
gribozavr Feb 25, 2016
63ec99b
stdlib: add argument labels to UTF16._copy()
gribozavr Feb 25, 2016
f6b2719
stdlib: replace UnicodeDecodingResult.isEmptyInput with Equatable
gribozavr Feb 25, 2016
488b464
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Feb 25, 2016
b319e3d
stdlib: Adjust to insert(contentsOf:at:) and append(contentsOf:)
jrose-apple Feb 25, 2016
5f4fec7
stdlib: remove UnicodeScalar.init()
gribozavr Feb 25, 2016
1f4d8e2
stdlib: UnicodeScalar.escape() => .escaped()
gribozavr Feb 25, 2016
6bb8045
stdlib: add better argument labels to transcode()
gribozavr Feb 25, 2016
836e778
stdlib: UTF16.measure() => .transcodedLength()
gribozavr Feb 25, 2016
a77104d
Update tests after transcode() API changes
gribozavr Feb 26, 2016
2fe3a39
Fix call sites of unsafeBitCast() in the Glibc overlay
gribozavr Feb 27, 2016
a49dab6
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Feb 29, 2016
71384c7
Removing unnecessary test command
Feb 29, 2016
e48f452
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swi…
Feb 29, 2016
234bc28
[stdlib] fixing compilation on Linux
Feb 29, 2016
a61d9d0
[stdlib] availability attributes for UnsafePointer.destroy
Mar 1, 2016
859db53
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Mar 1, 2016
27c4074
stdlib: docs: fix a reference to a type that does not exist
gribozavr Mar 1, 2016
cf4bafe
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Mar 3, 2016
43a5d4c
stdlib: rename Array.appendContents(of:) to Array.append(contentsOf:)
gribozavr Mar 4, 2016
7fe6916
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Mar 7, 2016
1fae0d1
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Mar 8, 2016
4da439d
copy(withZone:) => copy(with:) in ShadowProtocols
Mar 8, 2016
02006f2
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Mar 10, 2016
aacc0f8
merging RangeReplaceableCollectionType into RangeReplaceableCollection
Mar 10, 2016
bcc08b6
fixing availability attribute hint for joinWithSeparator
Mar 10, 2016
885b564
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
Mar 10, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion benchmark/single-source/AngryPhonebook.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public func run_AngryPhonebook(N: Int) {
for _ in 1...N {
for firstname in words {
for lastname in words {
(firstname.uppercaseString, lastname.lowercaseString)
(firstname.uppercased, lastname.lowercased)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/ArrayInClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ArrayContainer {
final var arr : [Int]

init() {
arr = [Int] (count: 100_000, repeatedValue: 0)
arr = [Int] (repeating: 0, count: 100_000)
}

func runLoop(N: Int) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/ArrayOfGenericPOD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RefArray<T> {
var array : [T]

init(_ i:T) {
array = [T](count: 100000, repeatedValue: i)
array = [T](repeating: i, count: 100000)
}
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/ArrayOfGenericRef.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class RefArray<T> {
var array : [T]

init(_ i:T, count:Int = 10_000) {
array = [T](count: count, repeatedValue: i)
array = [T](repeating: i, count: count)
}
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/ArrayOfPOD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RefArray<T> {
var array : [T]

init(_ i:T, count:Int = 100_000) {
array = [T](count: count, repeatedValue: i)
array = [T](repeating: i, count: count)
}
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/ArrayOfRef.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class RefArray<T> {
var array : [T]

init(_ i:T, count:Int = 10_000) {
array = [T](count: count, repeatedValue: i)
array = [T](repeating: i, count: count)
}
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/ArraySubscript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public func run_ArraySubscript(N: Int) {

func bound(x: Int) -> Int { return min(x, numArrayElements-1) }

var arrays = [[Int]](count: numArrays, repeatedValue: [])
var arrays = [[Int]](repeating: [], count: numArrays)
for i in 0..<numArrays {
for _ in 0..<numArrayElements {
arrays[i].append(Int(truncatingBitPattern: Random()))
Expand Down
10 changes: 5 additions & 5 deletions benchmark/single-source/CaptureProp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ func sum(x:Int, y:Int) -> Int {
}

@inline(never)
func benchCaptureProp<S : SequenceType
func benchCaptureProp<S : Sequence
>(
s:S, _ f:(S.Generator.Element, S.Generator.Element)->S.Generator.Element) -> S.Generator.Element {
s:S, _ f:(S.Iterator.Element, S.Iterator.Element)->S.Iterator.Element) -> S.Iterator.Element {

var g = s.generate()
let initial = g.next()!
return GeneratorSequence(g).reduce(initial, combine: f)
var it = s.makeIterator()
let initial = it.next()!
return IteratorSequence(it).reduce(initial, combine: f)
}

public func run_CaptureProp(N: Int) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/DictionaryRemove.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public func run_DictionaryRemove(N: Int) {
tmpDict = dict
// Empty dictionary
for i in 1...size {
tmpDict.removeValueForKey(i)
tmpDict.removeValue(forKey: i)
}
if !tmpDict.isEmpty {
break
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/ErrorHandling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import TestsUtils

enum PizzaError : ErrorType {
enum PizzaError : ErrorProtocol {
case Pepperoni, Olives, Anchovy
}

Expand Down
8 changes: 4 additions & 4 deletions benchmark/single-source/Hash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Hash {
// Hash state:
final var messageLength : Int = 0
final var dataLength : Int = 0
final var data = [UInt8](count: 64, repeatedValue: 0)
final var data = [UInt8](repeating: 0, count: 64)
final var blocksize : Int

/// \brief Hash the internal data.
Expand Down Expand Up @@ -223,7 +223,7 @@ class MD5 : Hash {
return first | second | third | fourth
}

var w = [UInt32](count: 16, repeatedValue: 0)
var w = [UInt32](repeating: 0, count: 16)
override
func hash() {
assert(dataLength == blocksize, "Invalid block size")
Expand Down Expand Up @@ -362,7 +362,7 @@ class SHA1 : Hash {
assert(dataLength == blocksize, "Invalid block size")

// Init the "W" buffer.
var w = [UInt32](count: 80, repeatedValue: 0)
var w = [UInt32](repeating: 0, count: 80)

// Convert the Byte array to UInt32 array.
var word : UInt32 = 0
Expand Down Expand Up @@ -497,7 +497,7 @@ class SHA256 : Hash {
assert(dataLength == blocksize, "Invalid block size")

// Init the "W" buffer.
var w = [UInt32](count: 64, repeatedValue: 0)
var w = [UInt32](repeating: 0, count: 64)

// Convert the Byte array to UInt32 array.
var word : UInt32 = 0
Expand Down
4 changes: 2 additions & 2 deletions benchmark/single-source/Histogram.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import TestsUtils

typealias rrggbb_t = UInt32

func output_sorted_sparse_rgb_histogram<S: SequenceType where S.Generator.Element == rrggbb_t>(samples: S, _ N: Int) {
func output_sorted_sparse_rgb_histogram<S: Sequence where S.Iterator.Element == rrggbb_t>(samples: S, _ N: Int) {
var histogram = Dictionary<rrggbb_t, Int>()
for _ in 1...50*N {
for sample in samples { // This part is really awful, I agree
let i = histogram.indexForKey(sample)
let i = histogram.index(forKey: sample)
histogram[sample] = (i != nil ? histogram[i!].1 : 0) + 1
}
}
Expand Down
4 changes: 2 additions & 2 deletions benchmark/single-source/Join.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public func run_Join(N: Int) {
for x in 0..<1000 * N {
array.append(String(x))
}
_ = array.joinWithSeparator("")
_ = array.joinWithSeparator(" ")
_ = array.joined(separator: "")
_ = array.joined(separator: " ")
}
2 changes: 1 addition & 1 deletion benchmark/single-source/Memset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func memset(a: inout [Int], _ c: Int) {

@inline(never)
public func run_Memset(N: Int) {
var a = [Int](count: 10_000, repeatedValue: 0)
var a = [Int](repeating: 0, count: 10_000)
for _ in 1...50*N {
memset(&a, 1)
memset(&a, 0)
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/MonteCarloE.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import TestsUtils

public func run_MonteCarloE(scale: Int) {
let N = 200000*scale
var intervals = [Bool](count: N, repeatedValue: false)
var intervals = [Bool](repeating: false, count: N)
for _ in 1...N {
let pos = Int(UInt(truncatingBitPattern: Random())%UInt(N))
intervals[pos] = true
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/NSStringConversion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import TestsUtils
import Foundation

public func run_NSStringConversion(N: Int) {
let test:NSString = NSString(CString: "test", encoding: NSASCIIStringEncoding)!
let test:NSString = NSString(cString: "test", encoding: NSASCIIStringEncoding)!
for _ in 1...N * 10000 {
test as String
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/Phonebook.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ public func run_Phonebook(N: Int) {
}
for _ in 1...N {
var t = Names;
t.sortInPlace()
t.sort()
}
}
12 changes: 6 additions & 6 deletions benchmark/single-source/PopFront.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ let arrayCount = 1024

@inline(never)
public func run_PopFrontArray(N: Int) {
let orig = Array(count: arrayCount, repeatedValue: 1)
let orig = Array(repeating: 1, count: arrayCount)
var a = [Int]()
for _ in 1...20*N {
for _ in 1...reps {
var result = 0
a.appendContentsOf(orig)
a.append(contentsOf: orig)
while a.count != 0 {
result += a[0]
a.removeAtIndex(0)
a.remove(at: 0)
}
CheckResults(result == arrayCount, "IncorrectResults in StringInterpolation: \(result) != \(arrayCount)")
}
Expand All @@ -34,8 +34,8 @@ public func run_PopFrontArray(N: Int) {

@inline(never)
public func run_PopFrontUnsafePointer(N: Int) {
var orig = Array(count: arrayCount, repeatedValue: 1)
let a = UnsafeMutablePointer<Int>.alloc(arrayCount)
var orig = Array(repeating: 1, count: arrayCount)
let a = UnsafeMutablePointer<Int>(allocatingCapacity: arrayCount)
for _ in 1...100*N {
for _ in 1...reps {
for i in 0..<arrayCount {
Expand All @@ -51,6 +51,6 @@ public func run_PopFrontUnsafePointer(N: Int) {
CheckResults(result == arrayCount, "IncorrectResults in StringInterpolation: \(result) != \(arrayCount)")
}
}
a.dealloc(arrayCount)
a.deallocateCapacity(arrayCount)
}

10 changes: 5 additions & 5 deletions benchmark/single-source/PopFrontGeneric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ let arrayCount = 1024
// This test case exposes rdar://17440222 which caused rdar://17974483 (popFront
// being really slow).

func _arrayReplace<B: _ArrayBufferType, C: CollectionType
where C.Generator.Element == B.Element, B.Index == Int
func _arrayReplace<B: _ArrayBufferProtocol, C: Collection
where C.Iterator.Element == B.Element, B.Index == Int
>(
target: inout B, _ subRange: Range<Int>, _ newValues: C
) {
Expand All @@ -36,7 +36,7 @@ func _arrayReplace<B: _ArrayBufferType, C: CollectionType
let insertCount = numericCast(newValues.count) as Int
let growth = insertCount - eraseCount

if target.requestUniqueMutableBackingBuffer(oldCount + growth) != nil {
if target.requestUniqueMutableBackingBuffer(minimumCapacity: oldCount + growth) != nil {
target.replace(subRange: subRange, with: insertCount, elementsOf: newValues)
}
else {
Expand All @@ -47,12 +47,12 @@ func _arrayReplace<B: _ArrayBufferType, C: CollectionType

@inline(never)
public func run_PopFrontArrayGeneric(N: Int) {
let orig = Array(count: arrayCount, repeatedValue: 1)
let orig = Array(repeating: 1, count: arrayCount)
var a = [Int]()
for _ in 1...20*N {
for _ in 1...reps {
var result = 0
a.appendContentsOf(orig)
a.append(contentsOf: orig)
while a.count != 0 {
result += a[0]
_arrayReplace(&a._buffer, 0..<1, EmptyCollection())
Expand Down
4 changes: 2 additions & 2 deletions benchmark/single-source/Prims.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PriorityQueue {
// Create heap for graph with NUM nodes.
init(Num: Int) {
heap = Array<EdgeCost>()
graphIndexToHeapIndexMap = Array<Int?>(count: Num, repeatedValue:nil)
graphIndexToHeapIndexMap = Array<Int?>(repeating:nil, count: Num)
}

func isEmpty() -> Bool {
Expand Down Expand Up @@ -184,7 +184,7 @@ extension Edge : Hashable {
}

func Prims(graph : Array<GraphNode>, _ fun : (Int,Int)->Double) -> Array<Int?> {
var treeEdges = Array<Int?>(count:graph.count, repeatedValue:nil)
var treeEdges = Array<Int?>(repeating:nil, count:graph.count)

let queue = PriorityQueue(Num:graph.count)
// Make the minimum spanning tree root its own parent for simplicity.
Expand Down
4 changes: 2 additions & 2 deletions benchmark/single-source/RC4.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct RC4 {
var J : UInt8 = 0

init() {
State = [UInt8](count: 256, repeatedValue: 0)
State = [UInt8](repeating: 0, count: 256)
}

mutating
Expand Down Expand Up @@ -84,7 +84,7 @@ public func run_RC4(N: Int) {
let SecretData : [UInt8] = Array(Secret.utf8)
let KeyData : [UInt8] = Array(Key.utf8)

var LongData : [UInt8] = [UInt8](count: messageLen, repeatedValue: 0)
var LongData : [UInt8] = [UInt8](repeating: 0, count: messageLen)

for _ in 1...N {
// Generate a long message.
Expand Down
12 changes: 6 additions & 6 deletions benchmark/single-source/RGBHistogram.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import TestsUtils

@inline(never)
public func run_RGBHistogram(N: Int) {
var histogram = [(rrggbb_t, Int)]()
var histogram = [(key: rrggbb_t, value: Int)]()
for _ in 1...100*N {
histogram = createSortedSparseRGBHistogram(samples)
if !isCorrectHistogram(histogram) {
Expand Down Expand Up @@ -86,23 +86,23 @@ let samples: [rrggbb_t] = [
0x607F4D9F, 0x9733E55E, 0xA360439D, 0x1DB568FD, 0xB7A5C3A1, 0xBE84492D
]

func isCorrectHistogram(histogram: [(rrggbb_t, Int)]) -> Bool {
func isCorrectHistogram(histogram: [(key: rrggbb_t, value: Int)]) -> Bool {
return histogram.count == 157 &&
histogram[0].0 == 0x00808080 && histogram[0].1 == 54 &&
histogram[156].0 == 0x003B8D96 && histogram[156].1 == 1
}

func createSortedSparseRGBHistogram
<S: SequenceType where S.Generator.Element == rrggbb_t>
(samples: S) -> [(rrggbb_t, Int)] {
<S: Sequence where S.Iterator.Element == rrggbb_t>
(samples: S) -> [(key: rrggbb_t, value: Int)] {
var histogram = Dictionary<rrggbb_t, Int>()

for sample in samples {
let i = histogram.indexForKey(sample)
let i = histogram.index(forKey: sample)
histogram[sample] = ((i != nil) ? histogram[i!].1 : 0) + 1
}

return histogram.sort() {
return histogram.sorted() {
if $0.1 == $1.1 {
return $0.0 > $1.0
} else {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/RangeAssignment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import TestsUtils
@inline(never)
public func run_RangeAssignment(scale: Int) {
let range = 100..<200
var vector = [Double](count: 5000, repeatedValue: 0.0 )
var vector = [Double](repeating: 0.0 , count: 5000)
let alfa = 1.0
let N = 500*scale
for _ in 1...N {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/RecursiveOwnedParameter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ArrayWrapper {
var data: [Int]

init(_ count: Int, _ initialValue: Int) {
data = [Int](count: count, repeatedValue: initialValue)
data = [Int](repeating: initialValue, count: count)
}

func compare(b: ArrayWrapper, _ iteration: Int, _ stopIteration: Int) -> Bool {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/Sim2DArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct Array2D {
let cols: Int

init(numRows: Int, numCols: Int) {
storage = [Int](count: numRows * numCols, repeatedValue: 0)
storage = [Int](repeating: 0, count: numRows * numCols)
rows = numRows
cols = numCols
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/SortLettersInPlace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public func run_SortLettersInPlace(N: Int) {
]

// Sort the letters in place.
letters.sortInPlace {
letters.sort {
return $0.value < $1.value
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/single-source/SortStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ func benchSortStrings(words: [String]) {
// Notice that we _copy_ the array of words before we sort it.
// Pass an explicit '<' predicate to benchmark reabstraction thunks.
var tempwords = words
tempwords.sortInPlace(<)
tempwords.sort(isOrderedBefore: <)
}

public func run_SortStrings(N: Int) {
Expand Down
Loading