Fix VM memory allocation optimizations by reducing what we allocate on the heap
This commit is contained in:
@@ -15,10 +15,10 @@ func Abs(args ...object.Object) object.Object {
|
||||
return newError(err.Error())
|
||||
}
|
||||
|
||||
i := args[0].(*object.Integer)
|
||||
i := args[0].(object.Integer)
|
||||
value := i.Value
|
||||
if value < 0 {
|
||||
value = value * -1
|
||||
}
|
||||
return &object.Integer{Value: value}
|
||||
return object.Integer{Value: value}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user