mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-03 22:25:57 +00:00
Fix block range coalescing not working in algorithm.c
This commit is contained in:
parent
aff7f19580
commit
d0490672e1
2 changed files with 4 additions and 8 deletions
|
|
@ -672,7 +672,7 @@ enqueue(Differ *self, Operation op) {
|
|||
}
|
||||
break;
|
||||
case OpBlockRange:
|
||||
if (self->pending_op.block_index+1 == op.block_index) {
|
||||
if (self->pending_op.block_index_end+1 == op.block_index) {
|
||||
self->pending_op.block_index_end = op.block_index;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,19 +292,15 @@ func (r *rsync) ApplyDelta(output io.Writer, target io.ReadSeeker, op Operation)
|
|||
switch op.Type {
|
||||
case OpBlockRange:
|
||||
for i := op.BlockIndex; i <= op.BlockIndexEnd; i++ {
|
||||
err = write_block(Operation{
|
||||
if err = write_block(Operation{
|
||||
Type: OpBlock,
|
||||
BlockIndex: i,
|
||||
})
|
||||
if err != nil {
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
case OpBlock:
|
||||
err = write_block(op)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return write_block(op)
|
||||
case OpData:
|
||||
return write(op.Data)
|
||||
case OpHash:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue