-
Notifications
You must be signed in to change notification settings - Fork 0
Extract duplicated fnv1a64 hash function to shared utils module #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: mandubian <77193+mandubian@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot commit and push to remote PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR eliminates code duplication by extracting the fnv1a64 hash function into a shared utilities module, in accordance with the project's factorization guidelines (Rule #9).
- Creates a new
ccos::utils::hashmodule with the shared FNV-1a hash implementation - Updates both
orchestrator.rsandsynthesized_capability_storage.rsto use the shared function - Includes comprehensive unit tests and documentation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
ccos/src/utils/mod.rs |
Exports the new hash module |
ccos/src/utils/hash.rs |
Implements shared fnv1a64 function with documentation and tests |
ccos/src/synthesis/core/synthesized_capability_storage.rs |
Removes duplicate hash function and imports from utils |
ccos/src/planner/modular_planner/orchestrator.rs |
Removes duplicate hash function and imports from utils |
The
fnv1a64hash function was duplicated inorchestrator.rs(line 131) andsynthesized_capability_storage.rs(line 267), violating DRY principles.Changes
ccos/src/utils/hash.rswith sharedfnv1a64implementation and unit testsccos/src/utils/mod.rsto export the hash moduleorchestrator.rsandsynthesized_capability_storage.rsto import and usecrate::utils::hash::fnv1a64This follows the project's factorization guidelines (Rule #9) requiring shared utilities be placed in
ccos::utilsmodules.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Note
Centralizes hashing to avoid duplication and improve reuse.
ccos/src/utils/hash.rswith sharedfnv1a64and unit testsccos/src/utils/mod.rsnow exportshashorchestrator.rsandsynthesized_capability_storage.rsupdated touse crate::utils::hash::fnv1a64and remove local implementationsWritten by Cursor Bugbot for commit 69ed828. This will update automatically on new commits. Configure here.