Optimise array::join() SQL function (#1925)

This commit is contained in:
Tobie Morgan Hitchcock 2023-05-05 00:06:49 +01:00 committed by GitHub
parent d0e76e64a9
commit 0c752b43e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,7 +98,7 @@ pub fn intersect((array, other): (Array, Array)) -> Result<Value, Error> {
} }
pub fn join((arr, sep): (Array, String)) -> Result<Value, Error> { pub fn join((arr, sep): (Array, String)) -> Result<Value, Error> {
Ok(arr.into_iter().map(|s| s.to_raw_string()).collect::<Vec<_>>().join(&sep).into()) Ok(arr.into_iter().map(Value::as_raw_string).collect::<Vec<_>>().join(&sep).into())
} }
pub fn len((array,): (Array,)) -> Result<Value, Error> { pub fn len((array,): (Array,)) -> Result<Value, Error> {