On Mon, 26 Jan 2026 10:23:16 GMT, Eirik Bjørsnøs <[email protected]> wrote:

> Please review this small enhancement which makes `ZipFile.Source.Key` capture 
> the relevant `BasicFileAttributes` fields eagerly in its constructor instead 
> of calling into `BasicFileAttributes` for each `hashCode` or `equals` 
> invocation.
> 
> This reduces the memory footprint of `Key` instances. It should be 
> performance positive since we avoid creating `FileTime` instances once per 
> comparison and avoid synchronization getting the file key. 
> 
> Capturing fields early also improves readability by making it obvious from 
> the field declarations what information Key uses when comparing equality.
> 
> Pure refactoring, no tests updated, `noreg-trivial`.

This looks OK to me.

-------------

Marked as reviewed by jpai (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29411#pullrequestreview-3706893286

Reply via email to