Skip to content

Commit 41c732f

Browse files
committed
---
yaml --- r: 243170 b: refs/heads/swift-5.0-branch c: 18ad793 h: refs/heads/master
1 parent d77f36b commit 41c732f

File tree

4 files changed

+30
-8
lines changed

4 files changed

+30
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2017-12-23-a: b7c074342459a645779f106c42bf4
643643
refs/heads/master-llvm-swift5-transition: 8ace18c8953afb3d7d94cf04cacc0b51a7e5f1e3
644644
"refs/heads/revert-12883-disable_modelio_test_ios": a77ae373b809a0d8cb460cf3d1585d618510d242
645645
refs/heads/revert-13597-master: cccee1df039d072215f9bddc2cbc1e32a8d5d5ee
646-
refs/heads/swift-5.0-branch: 546c829491cb939a677c9c24edd12d82062a1904
646+
refs/heads/swift-5.0-branch: 18ad79378f60108192a07ad3e7885ff6779c42ec
647647
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-23-a: b32214f7e04339dfada623b6b76dbebfb41e4541
648648
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-24-a: 1eb0be506c0744c7eff0550a10240286046e181d
649649
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-25-a: f35a91502bad0065c83d8760407c23be7b899f48

branches/swift-5.0-branch/stdlib/public/core/Dictionary.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ extension Dictionary: Equatable where Value: Equatable {
14991499

15001500
#if _runtime(_ObjC)
15011501
case (.cocoa(let lhsCocoa), .cocoa(let rhsCocoa)):
1502-
return _stdlib_NSObject_isEqual(lhsCocoa.object, rhsCocoa.object)
1502+
return lhsCocoa == rhsCocoa
15031503

15041504
case (.native(let lhsNative), .cocoa(let rhsCocoa)):
15051505

@@ -3057,7 +3057,7 @@ internal struct _CocoaDictionary: _DictionaryBuffer {
30573057
i = i.successor()
30583058
}
30593059

3060-
@inlinable // FIXME(sil-serialize-all)
3060+
@usableFromInline
30613061
internal func index(forKey key: Key) -> Index? {
30623062
// Fast path that does not involve creating an array of all keys. In case
30633063
// the key is present, this lookup is a penalty for the slow path, but the
@@ -3135,6 +3135,16 @@ internal struct _CocoaDictionary: _DictionaryBuffer {
31353135
return result
31363136
}
31373137
}
3138+
3139+
extension _CocoaDictionary: Equatable {
3140+
@usableFromInline
3141+
internal static func ==(
3142+
lhs: _CocoaDictionary,
3143+
rhs: _CocoaDictionary
3144+
) -> Bool {
3145+
return _stdlib_NSObject_isEqual(lhs.object, rhs.object)
3146+
}
3147+
}
31383148
#endif
31393149

31403150
extension Dictionary {

branches/swift-5.0-branch/stdlib/public/core/Hashing.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// This file implements helpers for hashing collections.
1515
//
1616

17+
import SwiftShims
18+
1719
/// The inverse of the default hash table load factor. Factored out so that it
1820
/// can be used in multiple places in the implementation and stay consistent.
1921
/// Should not be used outside `Dictionary` implementation.
@@ -27,8 +29,6 @@ internal var _hashContainerDefaultMaxLoadFactorInverse: Double {
2729
///
2830
/// This function is part of the runtime because `Bool` type is bridged to
2931
/// `ObjCBool`, which is in Foundation overlay.
30-
/// FIXME(sil-serialize-all): this should be internal
31-
@usableFromInline // FIXME(sil-serialize-all)
3232
@_silgen_name("swift_stdlib_NSObject_isEqual")
3333
internal func _stdlib_NSObject_isEqual(_ lhs: AnyObject, _ rhs: AnyObject) -> Bool
3434
#endif

branches/swift-5.0-branch/stdlib/public/core/Set.swift

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ extension Set: Equatable {
429429

430430
#if _runtime(_ObjC)
431431
case (.cocoa(let lhsCocoa), .cocoa(let rhsCocoa)):
432-
return _stdlib_NSObject_isEqual(lhsCocoa.object, rhsCocoa.object)
432+
return lhsCocoa == rhsCocoa
433433

434434
case (.native(let lhsNative), .cocoa(let rhsCocoa)):
435435
if lhsNative.count != rhsCocoa.count {
@@ -2431,6 +2431,18 @@ internal struct _CocoaSet {
24312431
internal init(_ object: _NSSet) {
24322432
self.object = object
24332433
}
2434+
}
2435+
2436+
extension _CocoaSet: Equatable {
2437+
@usableFromInline
2438+
internal static func ==(lhs: _CocoaSet, rhs: _CocoaSet) -> Bool {
2439+
return _stdlib_NSObject_isEqual(lhs.object, rhs.object)
2440+
}
2441+
}
2442+
2443+
extension _CocoaSet: _SetBuffer {
2444+
@usableFromInline
2445+
internal typealias Element = AnyObject
24342446

24352447
@inlinable
24362448
internal var startIndex: Index {
@@ -2453,7 +2465,7 @@ internal struct _CocoaSet {
24532465
i = i.successor()
24542466
}
24552467

2456-
@inlinable
2468+
@usableFromInline
24572469
internal func index(forKey key: AnyObject) -> Index? {
24582470
// Fast path that does not involve creating an array of all keys. In case
24592471
// the key is present, this lookup is a penalty for the slow path, but the
@@ -2486,7 +2498,7 @@ internal struct _CocoaSet {
24862498
return object.member(element) != nil
24872499
}
24882500

2489-
@inlinable // FIXME(sil-serialize-all)
2501+
@usableFromInline
24902502
internal func assertingGet(at i: Index) -> AnyObject {
24912503
let value: AnyObject? = i.allKeys[i.currentKeyIndex]
24922504
_sanityCheck(value != nil, "Item not found in underlying NSSet")

0 commit comments

Comments
 (0)