File tree 1 file changed +6
-5
lines changed
datafusion/physical-plan/src/aggregates/group_values/single_group_by
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -366,17 +366,15 @@ where
366
366
let block_id = O :: get_block_id ( * g) ;
367
367
let block_offset = O :: get_block_offset ( * g) ;
368
368
self . values
369
- . get ( block_id as usize )
370
- . unwrap ( )
369
+ . get_unchecked ( block_id as usize )
371
370
. get_unchecked ( block_offset as usize )
372
371
. is_eq ( key)
373
372
} ,
374
373
|g| unsafe {
375
374
let block_id = O :: get_block_id ( * g) ;
376
375
let block_offset = O :: get_block_offset ( * g) ;
377
376
self . values
378
- . get ( block_id as usize )
379
- . unwrap ( )
377
+ . get_unchecked ( block_id as usize )
380
378
. get_unchecked ( block_offset as usize )
381
379
. hash ( state)
382
380
} ,
@@ -391,7 +389,10 @@ where
391
389
// Get block infos and update block,
392
390
// we need `current block` and `next offset in block`
393
391
let block_id = self . values . len ( ) as u32 - 1 ;
394
- let current_block = self . values . last_mut ( ) . unwrap ( ) ;
392
+ let current_block = unsafe {
393
+ let last_index = self . values . len ( ) - 1 ;
394
+ self . values . get_unchecked_mut ( last_index)
395
+ } ;
395
396
let block_offset = current_block. len ( ) as u64 ;
396
397
current_block. push ( key) ;
397
398
You can’t perform that action at this time.
0 commit comments