File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1674,14 +1674,16 @@ trait RcBoxPtr<T: ?Sized> {
1674
1674
1675
1675
#[ inline]
1676
1676
fn inc_strong ( & self ) {
1677
+ let strong = self . strong ( ) ;
1678
+
1677
1679
// We want to abort on overflow instead of dropping the value.
1678
1680
// The reference count will never be zero when this is called;
1679
1681
// nevertheless, we insert an abort here to hint LLVM at
1680
1682
// an otherwise missed optimization.
1681
- if self . strong ( ) == 0 || self . strong ( ) == usize:: max_value ( ) {
1683
+ if strong == 0 || strong == usize:: max_value ( ) {
1682
1684
unsafe { abort ( ) ; }
1683
1685
}
1684
- self . inner ( ) . strong . set ( self . strong ( ) + 1 ) ;
1686
+ self . inner ( ) . strong . set ( strong + 1 ) ;
1685
1687
}
1686
1688
1687
1689
#[ inline]
@@ -1696,14 +1698,16 @@ trait RcBoxPtr<T: ?Sized> {
1696
1698
1697
1699
#[ inline]
1698
1700
fn inc_weak ( & self ) {
1701
+ let weak = self . weak ( ) ;
1702
+
1699
1703
// We want to abort on overflow instead of dropping the value.
1700
1704
// The reference count will never be zero when this is called;
1701
1705
// nevertheless, we insert an abort here to hint LLVM at
1702
1706
// an otherwise missed optimization.
1703
- if self . weak ( ) == 0 || self . weak ( ) == usize:: max_value ( ) {
1707
+ if weak == 0 || weak == usize:: max_value ( ) {
1704
1708
unsafe { abort ( ) ; }
1705
1709
}
1706
- self . inner ( ) . weak . set ( self . weak ( ) + 1 ) ;
1710
+ self . inner ( ) . weak . set ( weak + 1 ) ;
1707
1711
}
1708
1712
1709
1713
#[ inline]
You can’t perform that action at this time.
0 commit comments