mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-10 14:36:06 +00:00
Fix a comment in my_list.xx
This commit is contained in:
@@ -91,7 +91,7 @@ class MyList {
|
||||
|
||||
/* 列表扩容 */
|
||||
func extendCapacity() {
|
||||
// 新建一个长度为 size 的数组,并将原数组拷贝到新数组
|
||||
// 新建一个长度为原数组 extendRatio 倍的新数组,并将原数组拷贝到新数组
|
||||
nums = nums + Array(repeating: 0, count: _capacity * (extendRatio - 1))
|
||||
// 更新列表容量
|
||||
_capacity = nums.count
|
||||
|
||||
Reference in New Issue
Block a user