@@ -1151,12 +1151,12 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::KV>
1151
1151
let new_len = self . node . len ( ) - self . idx - 1 ;
1152
1152
1153
1153
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 ) ,
1155
1155
new_node. keys . as_mut_ptr ( ) ,
1156
1156
new_len
1157
1157
) ;
1158
1158
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 ) ,
1160
1160
new_node. vals . as_mut_ptr ( ) ,
1161
1161
new_len
1162
1162
) ;
@@ -1209,17 +1209,17 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
1209
1209
let new_len = self . node . len ( ) - self . idx - 1 ;
1210
1210
1211
1211
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 ) ,
1213
1213
new_node. data . keys . as_mut_ptr ( ) ,
1214
1214
new_len
1215
1215
) ;
1216
1216
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 ) ,
1218
1218
new_node. data . vals . as_mut_ptr ( ) ,
1219
1219
new_len
1220
1220
) ;
1221
1221
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 ) ,
1223
1223
new_node. edges . as_mut_ptr ( ) ,
1224
1224
new_len + 1
1225
1225
) ;
@@ -1283,14 +1283,14 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
1283
1283
slice_remove ( self . node . keys_mut ( ) , self . idx ) ) ;
1284
1284
ptr:: copy_nonoverlapping (
1285
1285
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 ) ,
1287
1287
right_len
1288
1288
) ;
1289
1289
ptr:: write ( left_node. vals_mut ( ) . get_unchecked_mut ( left_len) ,
1290
1290
slice_remove ( self . node . vals_mut ( ) , self . idx ) ) ;
1291
1291
ptr:: copy_nonoverlapping (
1292
1292
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 ) ,
1294
1294
right_len
1295
1295
) ;
1296
1296
@@ -1309,7 +1309,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
1309
1309
. as_internal_mut ( )
1310
1310
. edges
1311
1311
. as_mut_ptr ( )
1312
- . offset ( left_len as isize + 1 ) ,
1312
+ . add ( left_len + 1 ) ,
1313
1313
right_len + 1
1314
1314
) ;
1315
1315
@@ -1394,10 +1394,10 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
1394
1394
1395
1395
// Make room for stolen elements in the right child.
1396
1396
ptr:: copy ( right_kv. 0 ,
1397
- right_kv. 0 . offset ( count as isize ) ,
1397
+ right_kv. 0 . add ( count) ,
1398
1398
right_len) ;
1399
1399
ptr:: copy ( right_kv. 1 ,
1400
- right_kv. 1 . offset ( count as isize ) ,
1400
+ right_kv. 1 . add ( count) ,
1401
1401
right_len) ;
1402
1402
1403
1403
// 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::
1418
1418
// Make room for stolen edges.
1419
1419
let right_edges = right. reborrow_mut ( ) . as_internal_mut ( ) . edges . as_mut_ptr ( ) ;
1420
1420
ptr:: copy ( right_edges,
1421
- right_edges. offset ( count as isize ) ,
1421
+ right_edges. add ( count) ,
1422
1422
right_len + 1 ) ;
1423
1423
right. correct_childrens_parent_links ( count, count + right_len + 1 ) ;
1424
1424
@@ -1463,10 +1463,10 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
1463
1463
move_kv ( right_kv, count - 1 , parent_kv, 0 , 1 ) ;
1464
1464
1465
1465
// Fix right indexing
1466
- ptr:: copy ( right_kv. 0 . offset ( count as isize ) ,
1466
+ ptr:: copy ( right_kv. 0 . add ( count) ,
1467
1467
right_kv. 0 ,
1468
1468
new_right_len) ;
1469
- ptr:: copy ( right_kv. 1 . offset ( count as isize ) ,
1469
+ ptr:: copy ( right_kv. 1 . add ( count) ,
1470
1470
right_kv. 1 ,
1471
1471
new_right_len) ;
1472
1472
}
@@ -1480,7 +1480,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
1480
1480
1481
1481
// Fix right indexing.
1482
1482
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) ,
1484
1484
right_edges,
1485
1485
new_right_len + 1 ) ;
1486
1486
right. correct_childrens_parent_links ( 0 , new_right_len + 1 ) ;
@@ -1497,11 +1497,11 @@ unsafe fn move_kv<K, V>(
1497
1497
dest : ( * mut K , * mut V ) , dest_offset : usize ,
1498
1498
count : usize )
1499
1499
{
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) ,
1502
1502
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) ,
1505
1505
count) ;
1506
1506
}
1507
1507
@@ -1513,8 +1513,8 @@ unsafe fn move_edges<K, V>(
1513
1513
{
1514
1514
let source_ptr = source. as_internal_mut ( ) . edges . as_mut_ptr ( ) ;
1515
1515
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) ,
1518
1518
count) ;
1519
1519
dest. correct_childrens_parent_links ( dest_offset, dest_offset + count) ;
1520
1520
}
@@ -1604,8 +1604,8 @@ pub mod marker {
1604
1604
1605
1605
unsafe fn slice_insert < T > ( slice : & mut [ T ] , idx : usize , val : T ) {
1606
1606
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 ) ,
1609
1609
slice. len ( ) - idx
1610
1610
) ;
1611
1611
ptr:: write ( slice. get_unchecked_mut ( idx) , val) ;
@@ -1614,8 +1614,8 @@ unsafe fn slice_insert<T>(slice: &mut [T], idx: usize, val: T) {
1614
1614
unsafe fn slice_remove < T > ( slice : & mut [ T ] , idx : usize ) -> T {
1615
1615
let ret = ptr:: read ( slice. get_unchecked ( idx) ) ;
1616
1616
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) ,
1619
1619
slice. len ( ) - idx - 1
1620
1620
) ;
1621
1621
ret
0 commit comments