fix: fixed RemoveByIndex array list method

master
amorozov 2024-06-20 17:22:00 +03:00
parent 67744fd4a1
commit b244663a4d
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@ func (self *ArrayList[T]) Remove(element T) {
for index, value := range self.content {
if any(value) == any(element) {
indexFromMove = index + 1
indexFromMove = index
break
}
}
@ -50,7 +50,7 @@ func (self *ArrayList[T]) RemoveByIndex(index int) {
contentSize := len(self.content)
if index >= 0 {
for i := index; i < contentSize; i++ {
for i := index + 1; i < contentSize; i++ {
self.content[i-1] = self.content[i]
}