You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: address PR review feedback for proximity cache
Improvements based on review feedback:
1. Use HashSet for O(1) duplicate checking in update.rs
- Refactored get_broadcast_targets_update to use HashSet internally
- Changed from O(n*m) to O(n+m) complexity when combining subscribers and proximity neighbors
2. Implement Default trait for ProximityCacheManager
- Added Default trait implementation following Rust idioms
- Made new() method call Self::default()
3. Extract magic constant to module-level constant
- Created BATCH_ANNOUNCEMENT_INTERVAL constant (30 seconds)
- Replaced hardcoded durations at lines 263 and 365
4. Fix fragile Instant→SystemTime conversion
- Changed get_introspection_data return type to use Duration instead of SystemTime
- Now returns time-since-last-update (monotonic, clock-change safe)
- More useful for debugging purposes
Tests: 215 unit tests passing
[AI-assisted debugging and comment]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments