Skip to content

Refactor weight management in WeightStore to use checked arithmetic f…#43

Merged
TKorr merged 1 commit intomainfrom
safe-try-insert-d7ff7
Mar 1, 2026
Merged

Refactor weight management in WeightStore to use checked arithmetic f…#43
TKorr merged 1 commit intomainfrom
safe-try-insert-d7ff7

Conversation

@TKorr
Copy link
Contributor

@TKorr TKorr commented Mar 1, 2026

…or safety. Replace debug assertions with runtime assertions to ensure invariants are maintained during weight updates. This change enhances error handling and prevents potential underflows in total weight calculations during insertions and removals.

Description

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or modification

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing

Test environment:

  • OS:
  • Rust version:

Checklist

  • My code follows the project's coding standards
  • I have run cargo fmt and cargo clippy
  • I have added tests for my changes
  • All new and existing tests pass (cargo test)
  • I have updated the documentation as needed
  • I have added an entry to CHANGELOG.md (if applicable)

Screenshots (if applicable)

Additional Notes

…or safety. Replace debug assertions with runtime assertions to ensure invariants are maintained during weight updates. This change enhances error handling and prevents potential underflows in total weight calculations during insertions and removals.
@TKorr TKorr self-assigned this Mar 1, 2026
@TKorr TKorr merged commit a4953e4 into main Mar 1, 2026
16 checks passed
@TKorr TKorr deleted the safe-try-insert-d7ff7 branch March 1, 2026 13:26
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