Skip to content

Commit

Permalink
Fix off-by-one error (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Apr 5, 2022
1 parent 7887d8b commit d5b8fd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-repository/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl<'repo> Id<'repo> {
}

fn calculate_auto_hex_len(num_packed_objects: u64) -> usize {
let mut len = 64 - num_packed_objects.leading_zeros() + 1;
let mut len = 64 - num_packed_objects.leading_zeros();
len = (len + 2 - 1) / 2;
len.max(7) as usize
}
Expand Down

0 comments on commit d5b8fd5

Please sign in to comment.