Repository navigation
FileCatalog: Use IncrementalHash for consistency and simplify CompareBytes - #17137
Merged
Merged
Conversation
Switch the list-identifier derivation from the legacy HashAlgorithm TransformBlock streaming API to IncrementalHash, matching the rest of the FileCatalog code (CatalogEntry.FromFile). Output is byte-for-byte identical (same SHA-256 over the same concatenation), as verified by the catalog fixture tests. Co-authored-by: Copilot <[email protected]> Copilot-Session: d4e0f156-2249-4165-96fb-c348b532a48b
Replace the manual byte-by-byte comparison loop with the built-in allocation-free ReadOnlySpan<byte>.SequenceCompareTo, which yields the same lexicographic ordering used for sorting and dedup. Co-authored-by: Copilot <[email protected]> Copilot-Session: d4e0f156-2249-4165-96fb-c348b532a48b
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines the managed FileCatalog CatalogBuilder implementation to make hashing behavior consistent and to simplify byte-array comparisons used for member sorting/deduplication, improving readability while keeping behavior stable.
Changes:
- Switch list-identifier derivation from
SHA256.TransformBlock/TransformFinalBlocktoIncrementalHashfor a cleaner incremental hashing flow. - Replace the manual byte-by-byte comparison helper with
SequenceCompareToon spans.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
akoeplinger
enabled auto-merge (squash)
July 17, 2026 09:24
ViktorHofer
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some improvement found after looking at the code some more in #17133