Explicitly mention overflow is what we're checking

This commit is contained in:
Michael Bradshaw 2022-03-23 08:14:53 -06:00 committed by GitHub
parent f5dd42bce5
commit 8d14c03568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2524,8 +2524,8 @@ fn inc_strong(&self) {
self.strong_ref().set(strong);
// We want to abort on overflow instead of dropping the value.
// Checking after the store instead of before allows for
// slightly better code generation.
// Checking for overflow after the store instead of before
// allows for slightly better code generation.
if core::intrinsics::unlikely(strong == 0) {
abort();
}
@ -2557,8 +2557,8 @@ fn inc_weak(&self) {
self.weak_ref().set(weak);
// We want to abort on overflow instead of dropping the value.
// Checking after the store instead of before allows for
// slightly better code generation.
// Checking for overflow after the store instead of before
// allows for slightly better code generation.
if core::intrinsics::unlikely(weak == 0) {
abort();
}