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:
parent
3e7ca9f192
commit
7427d59429
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user