Skip to content

Commit 8947c19

Browse files
committed
Add explanatory comment for new code
1 parent ded9c56 commit 8947c19

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/num/uint_macros.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,8 @@ macro_rules! uint_impl {
14911491
without modifying the original"]
14921492
#[inline]
14931493
pub const fn checked_ilog(self, base: Self) -> Option<u32> {
1494+
// Inform compiler of optimizations when the base is known at
1495+
// compile time and there's a cheaper method available.
14941496
if core::intrinsics::is_val_statically_known(base) {
14951497
if base == 2 {
14961498
return self.checked_ilog2();

0 commit comments

Comments
 (0)