Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Update src/compute/cast/dictionary_to.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Jorge Leitao <jorgecarleitao@gmail.com>
  • Loading branch information
ritchie46 and jorgecarleitao committed Jul 8, 2022
1 parent a77eb50 commit a59396b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/compute/cast/dictionary_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ where
Box::new(values.data_type().clone()),
is_ordered,
);
// Safety
// we errored if any cast overflowed
// Safety: this is safe because given a type `T` that fits in a `usize`, casting it to type `P` either overflows or also fits in a `usize`
unsafe { DictionaryArray::try_new_unchecked(data_type, casted_keys, values.clone()) }
}
}
Expand Down

0 comments on commit a59396b

Please sign in to comment.