Fix VM memory allocation optimizations by reducing what we allocate on the heap
This commit is contained in:
@@ -1220,16 +1220,16 @@ func testConstants2(t *testing.T, expected []interface{}, actual []object.Object
|
||||
)
|
||||
|
||||
case string:
|
||||
assert.Equal(constant, actual[i].(*object.String).Value)
|
||||
assert.Equal(constant, actual[i].(object.String).Value)
|
||||
|
||||
case int:
|
||||
assert.Equal(int64(constant), actual[i].(*object.Integer).Value)
|
||||
assert.Equal(int64(constant), actual[i].(object.Integer).Value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testIntegerObject(expected int64, actual object.Object) interface{} {
|
||||
result, ok := actual.(*object.Integer)
|
||||
result, ok := actual.(object.Integer)
|
||||
if !ok {
|
||||
return fmt.Errorf("object is not Integer. got=%T (%+v", actual, actual)
|
||||
}
|
||||
@@ -1242,7 +1242,7 @@ func testIntegerObject(expected int64, actual object.Object) interface{} {
|
||||
}
|
||||
|
||||
func testStringObject(expected string, actual object.Object) error {
|
||||
result, ok := actual.(*object.String)
|
||||
result, ok := actual.(object.String)
|
||||
if !ok {
|
||||
return fmt.Errorf("object is not String. got %T (%+v", actual, actual)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user