Skip to content

Commit 8be4df1

Browse files
committed
clippy fix - Refactor array parameter types in string_agg.rs
Update append_rows_typed and append_batch_values_typed to accept array references instead of values. Modify call sites in StringInputArray to pass references, improving memory efficiency and consistency across function calls.
1 parent 75faa42 commit 8be4df1

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

datafusion/functions-aggregate/src/string_agg.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,13 @@ impl<'a> StringInputArray<'a> {
353353
fn append_rows(&self, group_indices: &[usize]) -> Vec<(u32, u32)> {
354354
match self {
355355
Self::Utf8(array) => {
356-
StringAggGroupsAccumulator::append_rows_typed(*array, group_indices)
356+
StringAggGroupsAccumulator::append_rows_typed(array, group_indices)
357357
}
358358
Self::LargeUtf8(array) => {
359-
StringAggGroupsAccumulator::append_rows_typed(*array, group_indices)
359+
StringAggGroupsAccumulator::append_rows_typed(array, group_indices)
360360
}
361361
Self::Utf8View(array) => {
362-
StringAggGroupsAccumulator::append_rows_typed(*array, group_indices)
362+
StringAggGroupsAccumulator::append_rows_typed(array, group_indices)
363363
}
364364
}
365365
}
@@ -375,15 +375,15 @@ impl<'a> StringInputArray<'a> {
375375
Self::Utf8(array) => StringAggGroupsAccumulator::append_batch_values_typed(
376376
values,
377377
entries,
378-
*array,
378+
array,
379379
delimiter,
380380
emit_groups,
381381
),
382382
Self::LargeUtf8(array) => {
383383
StringAggGroupsAccumulator::append_batch_values_typed(
384384
values,
385385
entries,
386-
*array,
386+
array,
387387
delimiter,
388388
emit_groups,
389389
)
@@ -392,7 +392,7 @@ impl<'a> StringInputArray<'a> {
392392
StringAggGroupsAccumulator::append_batch_values_typed(
393393
values,
394394
entries,
395-
*array,
395+
array,
396396
delimiter,
397397
emit_groups,
398398
)
@@ -451,7 +451,7 @@ impl StringAggGroupsAccumulator {
451451
self.num_groups -= emit_groups as usize;
452452
}
453453

454-
fn append_rows_typed<'a, A>(array: A, group_indices: &[usize]) -> Vec<(u32, u32)>
454+
fn append_rows_typed<'a, A>(array: &A, group_indices: &[usize]) -> Vec<(u32, u32)>
455455
where
456456
A: StringArrayType<'a>,
457457
{
@@ -483,7 +483,7 @@ impl StringAggGroupsAccumulator {
483483
fn append_batch_values_typed<'a, A>(
484484
values: &mut [Option<String>],
485485
entries: &[(u32, u32)],
486-
array: A,
486+
array: &A,
487487
delimiter: &str,
488488
emit_groups: usize,
489489
) where

0 commit comments

Comments
 (0)