Fix VM memory allocation optimizations by reducing what we allocate on the heap
This commit is contained in:
@@ -20,7 +20,7 @@ func Input(args ...object.Object) object.Object {
|
||||
}
|
||||
|
||||
if len(args) == 1 {
|
||||
prompt := args[0].(*object.String).Value
|
||||
prompt := args[0].(object.String).Value
|
||||
fmt.Fprintf(os.Stdout, prompt)
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ func Input(args ...object.Object) object.Object {
|
||||
if err != nil && err != io.EOF {
|
||||
return newError(fmt.Sprintf("error reading input from stdin: %s", err))
|
||||
}
|
||||
return &object.String{Value: string(line)}
|
||||
return object.String{Value: string(line)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user