@@ -1494,8 +1494,7 @@ macro_rules! uint_impl {
1494
1494
// Preconditions for calling inner function `slow_ilog`:
1495
1495
//
1496
1496
// 1: base >= 2
1497
- // 2: x >= 1
1498
- // 3: x >= base
1497
+ // 2: x >= base
1499
1498
#[ inline( always) ]
1500
1499
const fn slow_ilog( x: $SelfT, base: $SelfT) -> u32 {
1501
1500
// Since x >= base, n >= 1
@@ -1524,12 +1523,12 @@ macro_rules! uint_impl {
1524
1523
}
1525
1524
1526
1525
if core:: intrinsics:: is_val_statically_known( self ) {
1527
- if self <= 0 { // precondition 2
1526
+ if self <= 0 {
1528
1527
None
1529
1528
} else if core:: intrinsics:: is_val_statically_known( base) {
1530
1529
if base <= 1 { // precondition 1
1531
1530
None
1532
- } else if self < base { // precondition 3
1531
+ } else if self < base { // precondition 2
1533
1532
Some ( 0 )
1534
1533
} else if base == 2 {
1535
1534
self . checked_ilog2( )
@@ -1540,7 +1539,7 @@ macro_rules! uint_impl {
1540
1539
}
1541
1540
} else if base <= 1 { // precondition 1
1542
1541
None
1543
- } else if self < base { // precondition 3
1542
+ } else if self < base { // precondition 2
1544
1543
Some ( 0 )
1545
1544
} else { // all preconditions satisfied
1546
1545
Some ( slow_ilog( self , base) )
@@ -1552,16 +1551,16 @@ macro_rules! uint_impl {
1552
1551
self . checked_ilog2( )
1553
1552
} else if base == 10 {
1554
1553
self . checked_ilog10( )
1555
- } else if self <= 0 { // precondition 2
1554
+ } else if self <= 0 {
1556
1555
None
1557
- } else if self < base { // precondition 3
1556
+ } else if self < base { // precondition 2
1558
1557
Some ( 0 )
1559
1558
} else { // all preconditions satisfied
1560
1559
Some ( slow_ilog( self , base) )
1561
1560
}
1562
- } else if self <= 0 || base <= 1 { // preconditions 1 and 2
1561
+ } else if self <= 0 || base <= 1 { // precondition 1
1563
1562
None
1564
- } else if self < base { // precondition 3
1563
+ } else if self < base { // precondition 2
1565
1564
Some ( 0 )
1566
1565
} else { // all preconditions satisfied
1567
1566
Some ( slow_ilog( self , base) )
0 commit comments