feat: add is_empty method to GitIndexCache and refactor Hungarian algorithm loop

- Introduced `is_empty` method in `GitIndexCache` to check if the cache has any entries.
- Refactored the loop in the `min_cost_assignment` function in `hungarian.rs` to use `enumerate` for improved readability and efficiency.
This commit is contained in:
Joe 2026-03-12 20:25:21 -05:00
parent a901848861
commit 22808e6140
2 changed files with 7 additions and 3 deletions

View file

@ -306,6 +306,10 @@ impl GitIndexCache {
self.entries.len()
}
pub fn is_empty(&self) -> bool {
self.entries.is_empty()
}
/// Returns `true` if the new content's blob SHA1 matches the git index
/// entry for this path, meaning the file on disk almost certainly
/// already has this content.