Skip to content

Commit

Permalink
Format array.go and array_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Sep 17, 2017
1 parent 2e7d024 commit e5e8015
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vm/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ func builtinArrayInstanceMethods() []*BuiltinMethodObject {
} else if index.value < 0 && -index.value > len(arr.Elements) {
elements[i] = NULL
} else if index.value < 0 {
elements[i] = arr.Elements[len(arr.Elements) + index.value]
elements[i] = arr.Elements[len(arr.Elements)+index.value]
} else {
elements[i] = arr.Elements[index.value]
}
Expand Down Expand Up @@ -1115,7 +1115,7 @@ func (a *ArrayObject) reverse() *ArrayObject {
reversedArrElems := make([]Object, arrLen)

for i, element := range a.Elements {
reversedArrElems[arrLen - i - 1] = element
reversedArrElems[arrLen-i-1] = element
}

newArr := &ArrayObject{
Expand Down
1 change: 0 additions & 1 deletion vm/array_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1460,4 +1460,3 @@ func TestArrayValuesAtMethodFail(t *testing.T) {
v.checkSP(t, i, 1)
}
}

0 comments on commit e5e8015

Please sign in to comment.