This commit is contained in:
krahets
2023-02-08 20:30:14 +08:00
parent 7156a5f832
commit 30ed83e5b1
10 changed files with 130 additions and 49 deletions

View File

@@ -1517,6 +1517,15 @@ comments: true
// 更新列表容量
_capacity = nums.count
}
/* 将列表转换为数组 */
func toArray() -> [Int] {
var nums = Array(repeating: 0, count: _size)
for i in 0 ..< _size {
nums[i] = get(index: i)
}
return nums
}
}
```