@@ -1151,12 +1151,12 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::KV>
11511151 let new_len = self . node . len ( ) - self . idx - 1 ;
11521152
11531153 ptr:: copy_nonoverlapping (
1154- self . node . keys ( ) . as_ptr ( ) . offset ( self . idx as isize + 1 ) ,
1154+ self . node . keys ( ) . as_ptr ( ) . add ( self . idx + 1 ) ,
11551155 new_node. keys . as_mut_ptr ( ) ,
11561156 new_len
11571157 ) ;
11581158 ptr:: copy_nonoverlapping (
1159- self . node . vals ( ) . as_ptr ( ) . offset ( self . idx as isize + 1 ) ,
1159+ self . node . vals ( ) . as_ptr ( ) . add ( self . idx + 1 ) ,
11601160 new_node. vals . as_mut_ptr ( ) ,
11611161 new_len
11621162 ) ;
@@ -1209,17 +1209,17 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
12091209 let new_len = self . node . len ( ) - self . idx - 1 ;
12101210
12111211 ptr:: copy_nonoverlapping (
1212- self . node . keys ( ) . as_ptr ( ) . offset ( self . idx as isize + 1 ) ,
1212+ self . node . keys ( ) . as_ptr ( ) . add ( self . idx + 1 ) ,
12131213 new_node. data . keys . as_mut_ptr ( ) ,
12141214 new_len
12151215 ) ;
12161216 ptr:: copy_nonoverlapping (
1217- self . node . vals ( ) . as_ptr ( ) . offset ( self . idx as isize + 1 ) ,
1217+ self . node . vals ( ) . as_ptr ( ) . add ( self . idx + 1 ) ,
12181218 new_node. data . vals . as_mut_ptr ( ) ,
12191219 new_len
12201220 ) ;
12211221 ptr:: copy_nonoverlapping (
1222- self . node . as_internal ( ) . edges . as_ptr ( ) . offset ( self . idx as isize + 1 ) ,
1222+ self . node . as_internal ( ) . edges . as_ptr ( ) . add ( self . idx + 1 ) ,
12231223 new_node. edges . as_mut_ptr ( ) ,
12241224 new_len + 1
12251225 ) ;
@@ -1283,14 +1283,14 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
12831283 slice_remove ( self . node . keys_mut ( ) , self . idx ) ) ;
12841284 ptr:: copy_nonoverlapping (
12851285 right_node. keys ( ) . as_ptr ( ) ,
1286- left_node. keys_mut ( ) . as_mut_ptr ( ) . offset ( left_len as isize + 1 ) ,
1286+ left_node. keys_mut ( ) . as_mut_ptr ( ) . add ( left_len + 1 ) ,
12871287 right_len
12881288 ) ;
12891289 ptr:: write ( left_node. vals_mut ( ) . get_unchecked_mut ( left_len) ,
12901290 slice_remove ( self . node . vals_mut ( ) , self . idx ) ) ;
12911291 ptr:: copy_nonoverlapping (
12921292 right_node. vals ( ) . as_ptr ( ) ,
1293- left_node. vals_mut ( ) . as_mut_ptr ( ) . offset ( left_len as isize + 1 ) ,
1293+ left_node. vals_mut ( ) . as_mut_ptr ( ) . add ( left_len + 1 ) ,
12941294 right_len
12951295 ) ;
12961296
@@ -1309,7 +1309,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
13091309 . as_internal_mut ( )
13101310 . edges
13111311 . as_mut_ptr ( )
1312- . offset ( left_len as isize + 1 ) ,
1312+ . add ( left_len + 1 ) ,
13131313 right_len + 1
13141314 ) ;
13151315
@@ -1394,10 +1394,10 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
13941394
13951395 // Make room for stolen elements in the right child.
13961396 ptr:: copy ( right_kv. 0 ,
1397- right_kv. 0 . offset ( count as isize ) ,
1397+ right_kv. 0 . add ( count) ,
13981398 right_len) ;
13991399 ptr:: copy ( right_kv. 1 ,
1400- right_kv. 1 . offset ( count as isize ) ,
1400+ right_kv. 1 . add ( count) ,
14011401 right_len) ;
14021402
14031403 // Move elements from the left child to the right one.
@@ -1418,7 +1418,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
14181418 // Make room for stolen edges.
14191419 let right_edges = right. reborrow_mut ( ) . as_internal_mut ( ) . edges . as_mut_ptr ( ) ;
14201420 ptr:: copy ( right_edges,
1421- right_edges. offset ( count as isize ) ,
1421+ right_edges. add ( count) ,
14221422 right_len + 1 ) ;
14231423 right. correct_childrens_parent_links ( count, count + right_len + 1 ) ;
14241424
@@ -1463,10 +1463,10 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
14631463 move_kv ( right_kv, count - 1 , parent_kv, 0 , 1 ) ;
14641464
14651465 // Fix right indexing
1466- ptr:: copy ( right_kv. 0 . offset ( count as isize ) ,
1466+ ptr:: copy ( right_kv. 0 . add ( count) ,
14671467 right_kv. 0 ,
14681468 new_right_len) ;
1469- ptr:: copy ( right_kv. 1 . offset ( count as isize ) ,
1469+ ptr:: copy ( right_kv. 1 . add ( count) ,
14701470 right_kv. 1 ,
14711471 new_right_len) ;
14721472 }
@@ -1480,7 +1480,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
14801480
14811481 // Fix right indexing.
14821482 let right_edges = right. reborrow_mut ( ) . as_internal_mut ( ) . edges . as_mut_ptr ( ) ;
1483- ptr:: copy ( right_edges. offset ( count as isize ) ,
1483+ ptr:: copy ( right_edges. add ( count) ,
14841484 right_edges,
14851485 new_right_len + 1 ) ;
14861486 right. correct_childrens_parent_links ( 0 , new_right_len + 1 ) ;
@@ -1497,11 +1497,11 @@ unsafe fn move_kv<K, V>(
14971497 dest : ( * mut K , * mut V ) , dest_offset : usize ,
14981498 count : usize )
14991499{
1500- ptr:: copy_nonoverlapping ( source. 0 . offset ( source_offset as isize ) ,
1501- dest. 0 . offset ( dest_offset as isize ) ,
1500+ ptr:: copy_nonoverlapping ( source. 0 . add ( source_offset) ,
1501+ dest. 0 . add ( dest_offset) ,
15021502 count) ;
1503- ptr:: copy_nonoverlapping ( source. 1 . offset ( source_offset as isize ) ,
1504- dest. 1 . offset ( dest_offset as isize ) ,
1503+ ptr:: copy_nonoverlapping ( source. 1 . add ( source_offset) ,
1504+ dest. 1 . add ( dest_offset) ,
15051505 count) ;
15061506}
15071507
@@ -1513,8 +1513,8 @@ unsafe fn move_edges<K, V>(
15131513{
15141514 let source_ptr = source. as_internal_mut ( ) . edges . as_mut_ptr ( ) ;
15151515 let dest_ptr = dest. as_internal_mut ( ) . edges . as_mut_ptr ( ) ;
1516- ptr:: copy_nonoverlapping ( source_ptr. offset ( source_offset as isize ) ,
1517- dest_ptr. offset ( dest_offset as isize ) ,
1516+ ptr:: copy_nonoverlapping ( source_ptr. add ( source_offset) ,
1517+ dest_ptr. add ( dest_offset) ,
15181518 count) ;
15191519 dest. correct_childrens_parent_links ( dest_offset, dest_offset + count) ;
15201520}
@@ -1604,8 +1604,8 @@ pub mod marker {
16041604
16051605unsafe fn slice_insert < T > ( slice : & mut [ T ] , idx : usize , val : T ) {
16061606 ptr:: copy (
1607- slice. as_ptr ( ) . offset ( idx as isize ) ,
1608- slice. as_mut_ptr ( ) . offset ( idx as isize + 1 ) ,
1607+ slice. as_ptr ( ) . add ( idx) ,
1608+ slice. as_mut_ptr ( ) . add ( idx + 1 ) ,
16091609 slice. len ( ) - idx
16101610 ) ;
16111611 ptr:: write ( slice. get_unchecked_mut ( idx) , val) ;
@@ -1614,8 +1614,8 @@ unsafe fn slice_insert<T>(slice: &mut [T], idx: usize, val: T) {
16141614unsafe fn slice_remove < T > ( slice : & mut [ T ] , idx : usize ) -> T {
16151615 let ret = ptr:: read ( slice. get_unchecked ( idx) ) ;
16161616 ptr:: copy (
1617- slice. as_ptr ( ) . offset ( idx as isize + 1 ) ,
1618- slice. as_mut_ptr ( ) . offset ( idx as isize ) ,
1617+ slice. as_ptr ( ) . add ( idx + 1 ) ,
1618+ slice. as_mut_ptr ( ) . add ( idx) ,
16191619 slice. len ( ) - idx - 1
16201620 ) ;
16211621 ret
0 commit comments