mirror of
https://github.com/NohamR/knowledge-kit.git
synced 2026-05-25 04:17:17 +00:00
docs: clang 插件开发
This commit is contained in:
29
Chapter1 - iOS/1.129.md
Normal file
29
Chapter1 - iOS/1.129.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Swift Dictionary 扩容机制
|
||||
|
||||
|
||||
|
||||
## Dictionary
|
||||
|
||||
```swift
|
||||
let dic = ["d": 4, "a": 1, "b": 2, "c": 3]
|
||||
print(dic)
|
||||
// ["c": 3, "d": 4, "a": 1, "b": 2]
|
||||
```
|
||||
|
||||
Dictionary 顺序会乱序
|
||||
|
||||
|
||||
|
||||
## KeyValuePairs
|
||||
|
||||
KeyValuePairs 顺序不会乱序
|
||||
|
||||
```swift
|
||||
let kvs: KeyValuePairs = ["d": 4, "a": 1, "b": 2, "c": 3]
|
||||
print(kvs)
|
||||
// ["d": 4, "a": 1, "b": 2, "c": 3]
|
||||
```
|
||||
|
||||
|
||||
|
||||
开放寻址法
|
||||
Reference in New Issue
Block a user