chore: Fix: may need the absolute start as tiebreaker to ensure deterministic behavior

This commit is contained in:
Chris Hennick 2024-06-08 15:13:09 -07:00
parent 894e0ad44c
commit 73396be9f9
No known key found for this signature in database
GPG key ID: DA47AABA4961C509

View file

@ -727,7 +727,7 @@ impl<R: Read + Seek> ZipArchive<R> {
}
let shared = ok_results
.into_iter()
.max_by_key(|shared| shared.dir_start - shared.offset)
.max_by_key(|shared| (shared.dir_start - shared.offset, shared.dir_start))
.unwrap();
reader.seek(io::SeekFrom::Start(shared.dir_start))?;
Ok(shared)