Skip to content

Commit 9d3a433

Browse files
committed
Integrate cache into CrcParams::new()
- [x] 5. Integrate cache into CrcParams::new() - Modify `CrcParams::new()` in `src/structs.rs` to use `cache::get_or_generate_keys()` - Replace direct call to `generate::keys()` with cache lookup - Ensure all existing functionality remains unchanged - Verify that the function signature and behavior are identical
1 parent d51fb6a commit 9d3a433

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.kiro/specs/crc-params-caching/tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- Ensure all cache operations are best-effort with graceful degradation
2727
- _Requirements: 4.3_
2828

29-
- [ ] 5. Integrate cache into CrcParams::new()
29+
- [x] 5. Integrate cache into CrcParams::new()
3030
- Modify `CrcParams::new()` in `src/structs.rs` to use `cache::get_or_generate_keys()`
3131
- Replace direct call to `generate::keys()` with cache lookup
3232
- Ensure all existing functionality remains unchanged

src/structs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![allow(dead_code)]
44

55
use crate::traits::{CrcCalculator, CrcWidth};
6-
use crate::{arch, generate, CrcAlgorithm, CrcParams};
6+
use crate::{arch, cache, CrcAlgorithm, CrcParams};
77

88
/// CRC-32 width implementation
99
#[derive(Clone, Copy)]
@@ -57,7 +57,7 @@ impl CrcParams {
5757
xorout: u64,
5858
check: u64,
5959
) -> Self {
60-
let keys = generate::keys(width, poly, reflected);
60+
let keys = cache::get_or_generate_keys(width, poly, reflected);
6161

6262
let algorithm = match width {
6363
32 => CrcAlgorithm::Crc32Custom,

0 commit comments

Comments
 (0)