Skip to content

Conversation

kouosi
Copy link
Contributor

@kouosi kouosi commented Oct 11, 2025

since max_load_percentage is unsigned it will never be less then zero

@jeffective
Copy link
Contributor

The existing implementation is just using a defensive programming pattern against future code changes.

The existing implementation is robust against the type changing to signed in the future (unlikely in this case, for sure), or the lower threshold changing as well. I think the existing pattern should remain as is.

@SeanTUT
Copy link
Contributor

SeanTUT commented Oct 12, 2025

If anything, what strikes me as odd about the current code is that max_load_percentage is a u64. If we want to just represent (0, 100], it would be best to use u7, but if we want to allow whatever integer and validate ourselves, then we should be using comptime_int.

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