1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-12 20:27:30 +08:00

made string splits *much* faster

This commit is contained in:
David P Hilton 2016-09-22 14:52:38 -06:00
parent 3e7ca9f192
commit 7427d59429

View File

@ -380,12 +380,7 @@ func builtinString_split(call FunctionCall) Value {
split = split[:limit]
}
valueArray := make([]Value, len(split))
for index, value := range split {
valueArray[index] = toValue_string(value)
}
return toValue_object(call.runtime.newArrayOf(valueArray))
return call.runtime.toValue(split)
}
}