File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1235,11 +1235,10 @@ impl RangeAllocator {
12351235 }
12361236
12371237 fn base_for ( & mut self , real_addr : RealAddr , byte_len : ByteLen ) -> SyntheticAddr {
1238- if let Some ( & ( base, capacity) ) = self . bases . get ( & real_addr) {
1239- if byte_len <= capacity {
1238+ if let Some ( & ( base, capacity) ) = self . bases . get ( & real_addr)
1239+ && byte_len <= capacity {
12401240 return base;
12411241 }
1242- }
12431242 let base = self . cursor ;
12441243 self . cursor = base + byte_len + 1 ;
12451244 self . bases . insert ( real_addr, ( base, byte_len) ) ;
@@ -1270,8 +1269,7 @@ impl<T: ByteRepr> ByteRepr for Ptr<T> {
12701269 self . len ( ) * T :: byte_size ( ) ,
12711270 ) ,
12721271 } ;
1273- let base =
1274- PTR_RANGE_ALLOC . with ( |a| a. borrow_mut ( ) . base_for ( self . kind . address ( ) , byte_len) ) ;
1272+ let base = PTR_RANGE_ALLOC . with ( |a| a. borrow_mut ( ) . base_for ( self . kind . address ( ) , byte_len) ) ;
12751273 let rebased = Ptr {
12761274 offset : 0 ,
12771275 kind : self . kind . clone ( ) ,
You can’t perform that action at this time.
0 commit comments