@@ -521,7 +521,7 @@ bool DCV_connect_with_base(DeltaChunkVector* tdcv, const DeltaChunkVector* bdcv)
521
521
DBG_check (tdcv );
522
522
DBG_check (bdcv );
523
523
524
- uint * offset_array = PyMem_Malloc (tdcv -> size * sizeof (uint ));
524
+ uint * const offset_array = PyMem_Malloc (tdcv -> size * sizeof (uint ));
525
525
if (!offset_array ){
526
526
return 0 ;
527
527
}
@@ -531,7 +531,6 @@ bool DCV_connect_with_base(DeltaChunkVector* tdcv, const DeltaChunkVector* bdcv)
531
531
532
532
DeltaChunk * dc = DCV_first (tdcv );
533
533
const DeltaChunk * dcend = DCV_end (tdcv );
534
- const ull oldsize = DCV_size (tdcv );
535
534
536
535
// OFFSET RUN
537
536
for (;dc < dcend ; dc ++ , pofs ++ )
@@ -563,9 +562,10 @@ bool DCV_connect_with_base(DeltaChunkVector* tdcv, const DeltaChunkVector* bdcv)
563
562
// Data chunks don't need processing
564
563
const uint ofs = * pofs ;
565
564
if (dc -> data ){
566
- // TODO: peak the preceeding chunks to figure out whether they are
565
+ // NOTE: could peek the preceeding chunks to figure out whether they are
567
566
// all just moved by ofs. In that case, they can move as a whole!
568
- // just copy the chunk according to its offset
567
+ // tests showed that this is very rare though, even in huge deltas, so its
568
+ // not worth the extra effort
569
569
if (ofs ){
570
570
memcpy ((void * )(dc + ofs ), (void * )dc , sizeof (DeltaChunk ));
571
571
}
@@ -584,7 +584,6 @@ bool DCV_connect_with_base(DeltaChunkVector* tdcv, const DeltaChunkVector* bdcv)
584
584
}
585
585
586
586
DBG_check (tdcv );
587
- assert (DCV_size (tdcv ) == oldsize );
588
587
589
588
PyMem_Free (offset_array );
590
589
return 1 ;
0 commit comments