Skip to content

add overflow protection to next_offset method in CalibrationThreshold#22

Merged
barafael merged 3 commits intobarafael:masterfrom
1-rafael-1:calibration_panics_on_next_offset
Jun 23, 2025
Merged

add overflow protection to next_offset method in CalibrationThreshold#22
barafael merged 3 commits intobarafael:masterfrom
1-rafael-1:calibration_panics_on_next_offset

Conversation

@1-rafael-1
Copy link

@1-rafael-1 1-rafael-1 commented Jun 22, 2025

attempts to fix issue #21

Copilot AI review requested due to automatic review settings June 22, 2025 13:55
Copy link

Copilot AI left a 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 adds overflow protection to the next_offset method in CalibrationThreshold to fix issue #24.

  • Corrects a typo in the comments ("espected" to "expected").
  • Implements saturating arithmetic to protect against overflow in offset adjustments.
  • Updates and adds tests to validate the new overflow protection behavior.

1-rafael-1 and others added 2 commits June 22, 2025 15:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@barafael barafael merged commit a8ad713 into barafael:master Jun 23, 2025
1 check passed
@barafael
Copy link
Owner

thanks!

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.

3 participants