diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-09-22 14:38:24 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-09-22 14:38:24 +0200 |
commit | d736642d6ea3ae42de3a30f39881c88a00e1a1f9 (patch) | |
tree | e8a8be7a79dcc02b88a3942dc68befc0700a0982 /repo.go | |
parent | 1b29f83c7f9f8afa4f1ab247513bcacc2507156f (diff) | |
download | dna-backup-d736642d6ea3ae42de3a30f39881c88a00e1a1f9.tar.gz dna-backup-d736642d6ea3ae42de3a30f39881c88a00e1a1f9.zip |
fix findSimilarChunk max is not updated
Diffstat (limited to 'repo.go')
-rw-r--r-- | repo.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -516,12 +516,13 @@ func (r *Repo) findSimilarChunk(chunk Chunk) (*ChunkId, bool) { count += 1 logger.Infof("found %d %d time(s)", id, count) if count > max { + max = count similarChunk = id } similarChunks[*id] = count } } - return similarChunk, similarChunk != nil + return similarChunk, max > 0 } func (r *Repo) tryDeltaEncodeChunk(temp BufferedChunk) (Chunk, bool) { |