Skip to content

Commit c88030f

Browse files
authored
Merge pull request swiftlang#18181 from lorentey/dictionary-review
[stdlib] Modernize Set and Dictionary internals
2 parents 4373ed8 + d1ec3b9 commit c88030f

File tree

10 files changed

+1958
-2140
lines changed

10 files changed

+1958
-2140
lines changed

stdlib/public/core/Dictionary.swift

Lines changed: 1059 additions & 1169 deletions
Large diffs are not rendered by default.

stdlib/public/core/Hashing.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,19 @@ internal func _stdlib_NSObject_isEqual(_ lhs: AnyObject, _ rhs: AnyObject) -> Bo
3939
///
4040
/// Accesses the underlying raw memory as Unmanaged<AnyObject> using untyped
4141
/// memory accesses. The memory remains bound to managed AnyObjects.
42-
@_fixed_layout // FIXME(sil-serialize-all)
43-
@usableFromInline // FIXME(sil-serialize-all)
4442
internal struct _UnmanagedAnyObjectArray {
4543
/// Underlying pointer.
46-
@usableFromInline // FIXME(sil-serialize-all)
4744
internal var value: UnsafeMutableRawPointer
4845

49-
@inlinable // FIXME(sil-serialize-all)
5046
internal init(_ up: UnsafeMutablePointer<AnyObject>) {
5147
self.value = UnsafeMutableRawPointer(up)
5248
}
5349

54-
@inlinable // FIXME(sil-serialize-all)
5550
internal init?(_ up: UnsafeMutablePointer<AnyObject>?) {
5651
guard let unwrapped = up else { return nil }
5752
self.init(unwrapped)
5853
}
5954

60-
@inlinable // FIXME(sil-serialize-all)
6155
internal subscript(i: Int) -> AnyObject {
6256
get {
6357
let unmanaged = value.load(

stdlib/public/core/SequenceAlgorithms.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extension Sequence {
4343
/// list consisting of indices of names with five or fewer letters.
4444
///
4545
/// let names: Set = ["Sofia", "Camilla", "Martina", "Mateo", "Nicolás"]
46-
/// var shorterIndices: [SetIndex<String>] = []
46+
/// var shorterIndices: [Set<String>.Index] = []
4747
/// for (i, name) in zip(names.indices, names) {
4848
/// if name.count <= 5 {
4949
/// shorterIndices.append(i)

0 commit comments

Comments
 (0)