aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
authorNikolay Edigaryev <edigaryev@gmail.com>2024-07-21 12:45:00 +0400
committerNikolay Edigaryev <edigaryev@gmail.com>2024-07-21 12:47:03 +0400
commit3a3f96c372b0f9a93ea27928baa4516e95a79bde (patch)
treec5b615f0e63e63db486828c539b0066dc738e6e9 /plumbing
parentfd40610a258675dfe4146d9e857d3217e7ca3724 (diff)
downloadgo-git-3a3f96c372b0f9a93ea27928baa4516e95a79bde.tar.gz
plumbing: format/packfile, early return
Co-authored-by: onee-only <kimww0306@gmail.com>
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/format/packfile/delta_index.go6
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