@@ -71,9 +71,9 @@ final internal class _SwiftDictionaryNSEnumerator<Key: Hashable, Value>
7171 _internalInvariant ( _isBridgedVerbatimToObjectiveC ( Key . self) )
7272 _internalInvariant ( _orphanedFoundationSubclassesReparented)
7373 self . base = base
74- self . bridgedKeys = nil
75- self . nextBucket = unsafe base. hashTable . startBucket
76- self . endBucket = unsafe base. hashTable . endBucket
74+ unsafe self. bridgedKeys = nil
75+ unsafe self. nextBucket = base. hashTable. startBucket
76+ unsafe self. endBucket = base. hashTable. endBucket
7777 super. init ( )
7878 }
7979
@@ -82,28 +82,28 @@ final internal class _SwiftDictionaryNSEnumerator<Key: Hashable, Value>
8282 _internalInvariant ( !_isBridgedVerbatimToObjectiveC( Key . self) )
8383 _internalInvariant ( _orphanedFoundationSubclassesReparented)
8484 self . base = deferred. native
85- self . bridgedKeys = unsafe deferred. bridgeKeys ( )
86- self . nextBucket = unsafe base. hashTable . startBucket
87- self . endBucket = unsafe base. hashTable . endBucket
85+ unsafe self. bridgedKeys = deferred. bridgeKeys ( )
86+ unsafe self. nextBucket = base. hashTable. startBucket
87+ unsafe self. endBucket = base. hashTable. endBucket
8888 super. init ( )
8989 }
9090
9191 private func bridgedKey( at bucket: _HashTable . Bucket ) -> AnyObject {
9292 unsafe _internalInvariant ( base. hashTable. isOccupied ( bucket) )
93- if let bridgedKeys = self . bridgedKeys {
93+ if let bridgedKeys = unsafe self. bridgedKeys {
9494 return unsafe bridgedKeys[ bucket]
9595 }
96- return _bridgeAnythingToObjectiveC ( base. uncheckedKey ( at: bucket) )
96+ return unsafe _bridgeAnythingToObjectiveC( base. uncheckedKey ( at: bucket) )
9797 }
9898
9999 @objc
100100 internal func nextObject( ) -> AnyObject ? {
101101 if unsafe nextBucket == endBucket {
102102 return nil
103103 }
104- let bucket = nextBucket
105- nextBucket = unsafe base. hashTable . occupiedBucket ( after: nextBucket)
106- return self . bridgedKey ( at: bucket)
104+ let bucket = unsafe nextBucket
105+ unsafe nextBucket = base. hashTable. occupiedBucket ( after: nextBucket)
106+ return unsafe self. bridgedKey ( at: bucket)
107107 }
108108
109109 @objc ( countByEnumeratingWithState: objects: count: )
@@ -128,7 +128,7 @@ final internal class _SwiftDictionaryNSEnumerator<Key: Hashable, Value>
128128 // enumeration, terminate it, and continue via NSEnumerator.
129129 let unmanagedObjects = unsafe _UnmanagedAnyObjectArray( objects)
130130 unsafe unmanagedObjects[ 0 ] = self . bridgedKey ( at: nextBucket)
131- nextBucket = unsafe base. hashTable . occupiedBucket ( after: nextBucket)
131+ unsafe nextBucket = base. hashTable. occupiedBucket ( after: nextBucket)
132132 unsafe state. pointee = theState
133133 return 1
134134 }
@@ -230,7 +230,8 @@ final internal class _SwiftDeferredNSDictionary<Key: Hashable, Value>
230230 owner: native. _storage,
231231 hashTable: native. hashTable)
232232 for unsafe bucket in unsafe native. hashTable {
233- let object = _bridgeAnythingToObjectiveC ( native. uncheckedKey ( at: bucket) )
233+ let object = unsafe _bridgeAnythingToObjectiveC(
234+ native. uncheckedKey ( at: bucket) )
234235 unsafe bridged. initialize ( at: bucket, to: object)
235236 }
236237
@@ -249,7 +250,7 @@ final internal class _SwiftDeferredNSDictionary<Key: Hashable, Value>
249250 owner: native. _storage,
250251 hashTable: native. hashTable)
251252 for unsafe bucket in unsafe native. hashTable {
252- let value = native. uncheckedValue ( at: bucket)
253+ let value = unsafe native. uncheckedValue ( at: bucket)
253254 let cocoaValue = _bridgeAnythingToObjectiveC ( value)
254255 unsafe bridged. initialize ( at: bucket, to: cocoaValue)
255256 }
@@ -274,7 +275,7 @@ final internal class _SwiftDeferredNSDictionary<Key: Hashable, Value>
274275 if let bridgedKeys = unsafe bridgedKeys {
275276 return unsafe bridgedKeys[ bucket]
276277 }
277- return _bridgeAnythingToObjectiveC ( native. uncheckedKey ( at: bucket) )
278+ return unsafe _bridgeAnythingToObjectiveC( native. uncheckedKey ( at: bucket) )
278279 }
279280
280281 @inline ( __always)
@@ -285,7 +286,7 @@ final internal class _SwiftDeferredNSDictionary<Key: Hashable, Value>
285286 if let bridgedValues = unsafe bridgedValues {
286287 return unsafe bridgedValues[ bucket]
287288 }
288- return _bridgeAnythingToObjectiveC ( native. uncheckedValue ( at: bucket) )
289+ return unsafe _bridgeAnythingToObjectiveC( native. uncheckedValue ( at: bucket) )
289290 }
290291
291292 @objc ( objectForKey: )
@@ -383,7 +384,7 @@ final internal class _SwiftDeferredNSDictionary<Key: Hashable, Value>
383384 count: Int
384385 ) -> Int {
385386 defer { _fixLifetime ( self ) }
386- let hashTable = native. hashTable
387+ let hashTable = unsafe native. hashTable
387388
388389 var theState = unsafe state. pointee
389390 if unsafe theState. state == 0 {
@@ -809,7 +810,7 @@ extension Dictionary {
809810 }
810811
811812 if let nativeStorage = unsafe s as? _DictionaryStorage < Key , Value > {
812- return Dictionary ( _native: _NativeDictionary ( nativeStorage) )
813+ return Dictionary ( _native: unsafe _NativeDictionary( nativeStorage) )
813814 }
814815
815816 if unsafe s === __RawDictionaryStorage. empty {
0 commit comments