MCPcopy Index your code
hub / github.com/kovidgoyal/kitty / enqueue

Method enqueue

tools/rsync/algorithm.go:400–435  ·  view source on GitHub ↗
(op Operation)

Source from the content-addressed store, hash-verified

398}
399
400func (self *diff) enqueue(op Operation) (err error) {
401 switch op.Type {
402 case OpBlock:
403 if self.pending_op != nil {
404 switch self.pending_op.Type {
405 case OpBlock:
406 if self.pending_op.BlockIndex+1 == op.BlockIndex {
407 self.pending_op = &Operation{
408 Type: OpBlockRange,
409 BlockIndex: self.pending_op.BlockIndex,
410 BlockIndexEnd: op.BlockIndex,
411 }
412 return
413 }
414 case OpBlockRange:
415 if self.pending_op.BlockIndexEnd+1 == op.BlockIndex {
416 self.pending_op.BlockIndexEnd = op.BlockIndex
417 return
418 }
419 }
420 if err = self.send_pending(); err != nil {
421 return err
422 }
423 }
424 self.pending_op = &op
425 case OpHash:
426 if err = self.send_pending(); err != nil {
427 return
428 }
429 if err = self.send_op(&op); err != nil {
430 return
431 }
432 }
433 return
434
435}
436
437func (self *diff) send_op(op *Operation) error {
438 b := self.op_write_buf[:op.SerializeSize()]

Callers 2

finish_upMethod · 0.95
read_nextMethod · 0.95

Calls 2

send_pendingMethod · 0.95
send_opMethod · 0.95

Tested by

no test coverage detected