Skip to content

Commit

Permalink
stats: faster detection of empty sample
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Aug 11, 2023
1 parent 6bc0991 commit b054815
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,8 +1468,8 @@ impl FieldType {
sample: &[u8],
current_type: FieldType,
) -> (FieldType, Option<i64>) {
#[allow(clippy::len_zero)]
if sample.len() == 0 {
// faster than sample.len() == 0 or sample.is_empty() per microbenchmarks
if b"" == sample {
return (TNull, None);
}
// no need to do type checking if current_type is already a String
Expand Down

0 comments on commit b054815

Please sign in to comment.