aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/delta_index.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/packfile/delta_index.go')
-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