Skip to content

Commit 296c7d4

Browse files
Update array.go
1 parent e9a0aa3 commit 296c7d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/05_array/array.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (this *Array) Len() uint {
3434

3535
//判断索引是否越界
3636
func (this *Array) isIndexOutOfRange(index uint) bool {
37-
if index >= this.length {
37+
if index >= uint(cap(this.data)) {
3838
return true
3939
}
4040
return false

0 commit comments

Comments
 (0)