Skip to content

refactor: extract shared hash_content into execute/hash.rs#282

Open
yangshun wants to merge 1 commit intovoidzero-dev:mainfrom
yangshun:refactor/deduplicate-hash-content
Open

refactor: extract shared hash_content into execute/hash.rs#282
yangshun wants to merge 1 commit intovoidzero-dev:mainfrom
yangshun:refactor/deduplicate-hash-content

Conversation

@yangshun
Copy link
Collaborator

@yangshun yangshun commented Mar 21, 2026

Summary

Extract the 8 KiB buffered xxHash3_64 hashing logic from fingerprint.rs and glob_inputs.rs into a shared execute/hash.rs module.

Note

I used Claude to find this duplication, reasoned with it back-and-forth to see if it was really an improvement, concluded that it was just a small one.

Both call sites were identical, but strictly speaking the logic doesn't need to be shared. If not desired, just close the PR.

Test plan

  • cargo test -p vite_task — all 27 tests pass

Both `fingerprint.rs` and `glob_inputs.rs` implemented identical 8 KiB
buffered xxHash3_64 hashing for cache invalidation. Extract into a
shared `hash.rs` module to ensure consistent hashes across code paths —
if either diverges, cache lookups would silently break.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yangshun yangshun force-pushed the refactor/deduplicate-hash-content branch from d753a7f to f92824f Compare March 21, 2026 02:33
@yangshun yangshun requested a review from branchseer March 21, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant