Fix a comment in my_list.xx

This commit is contained in:
krahets
2023-06-03 22:18:28 +08:00
parent d528b1ae07
commit 6377e3316a
8 changed files with 8 additions and 8 deletions

View File

@ -88,7 +88,7 @@ class MyList {
/* 列表扩容 */
public void extendCapacity() {
// 新建一个长度为 size 的数组,并将原数组拷贝到新数组
// 新建一个长度为原数组 extendRatio 倍的新数组,并将原数组拷贝到新数组
nums = Arrays.copyOf(nums, capacity() * extendRatio);
// 更新列表容量
capacity = nums.length;