diff options
author | Nikolay Edigaryev <edigaryev@gmail.com> | 2024-07-21 12:45:00 +0400 |
---|---|---|
committer | Nikolay Edigaryev <edigaryev@gmail.com> | 2024-07-21 12:47:03 +0400 |
commit | 3a3f96c372b0f9a93ea27928baa4516e95a79bde (patch) | |
tree | c5b615f0e63e63db486828c539b0066dc738e6e9 /plumbing/format | |
parent | fd40610a258675dfe4146d9e857d3217e7ca3724 (diff) | |
download | go-git-3a3f96c372b0f9a93ea27928baa4516e95a79bde.tar.gz |
plumbing: format/packfile, early return
Co-authored-by: onee-only <kimww0306@gmail.com>
Diffstat (limited to 'plumbing/format')
-rw-r--r-- | plumbing/format/packfile/delta_index.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/format/packfile/delta_index.go b/plumbing/format/packfile/delta_index.go index b2081c2..a60ec0b 100644 --- a/plumbing/format/packfile/delta_index.go +++ b/plumbing/format/packfile/delta_index.go @@ -35,12 +35,12 @@ func (idx *deltaIndex) findMatch(src, tgt []byte, tgtOffset int) (srcOffset, l i h := hashBlock(tgt, tgtOffset) tIdx := h & idx.mask eIdx := idx.table[tIdx] - if eIdx != 0 { - srcOffset = idx.entries[eIdx] - } else { + if eIdx == 0 { return } + srcOffset = idx.entries[eIdx] + l = matchLength(src, tgt, tgtOffset, srcOffset) return |