Skip to content

Commit

Permalink
Apply sugestion change
Browse files Browse the repository at this point in the history
  • Loading branch information
tlm365 committed Jan 7, 2025
1 parent af3a6da commit f00aebb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datafusion/functions/src/unicode/reverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ pub fn reverse<T: OffsetSizeTrait>(args: &[ArrayRef]) -> Result<ArrayRef> {
fn reverse_impl<'a, T: OffsetSizeTrait, V: StringArrayType<'a>>(
string_array: V,
) -> Result<ArrayRef> {
let mut builder: GenericStringBuilder<T> =
GenericStringBuilder::with_capacity(string_array.len(), 1024);
let mut builder = GenericStringBuilder::<T>::with_capacity(string_array.len(), 1024);

let mut reversed = String::new();
for string in string_array.iter() {
if let Some(s) = string {
let mut reversed = String::with_capacity(s.len());
reversed.extend(s.chars().rev());
builder.append_value(reversed);
builder.append_value(&reversed);
reversed.clear();
} else {
builder.append_null();
}
Expand Down

0 comments on commit f00aebb

Please sign in to comment.