Showing the changes to git-commitgraph/src/file (1 of 2 files). Show all
Unified · Split
| @@ -70,7 +70,8 @@ impl File { · 69 unmodified lines | |||
| 70 | 70 | ||
| 71 | /// Translate the given object hash to its position within this file, if present. | 71 | /// Translate the given object hash to its position within this file, if present. |
| 72 | // copied from git-odb/src/pack/index/access.rs | 72 | // copied from git-odb/src/pack/index/access.rs |
| 73 | pub fn lookup(&self, id: &git_hash::oid) -> Option<file::Position> { | 73 | pub fn lookup(&self, id: impl AsRef<git_hash::oid>) -> Option<file::Position> { |
| 74 | let id = id.as_ref(); | ||
| 74 | let first_byte = usize::from(id.first_byte()); | 75 | let first_byte = usize::from(id.first_byte()); |
| 75 | let mut upper_bound = self.fan[first_byte]; | 76 | let mut upper_bound = self.fan[first_byte]; |
| 76 | let mut lower_bound = if first_byte != 0 { self.fan[first_byte - 1] } else { 0 }; | 77 | let mut lower_bound = if first_byte != 0 { self.fan[first_byte - 1] } else { 0 }; |