aboutsummaryrefslogtreecommitdiff
path: root/repo.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-09 14:01:00 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-09 14:01:00 +0200
commit1809540dc87c665cafcd6daf514b39b4a17e483f (patch)
tree61cd19f81988d245697fbb40a7462131968ee3a8 /repo.go
parent27cf33b15ee5c028f4816607c034df68adf7df4f (diff)
downloaddna-backup-1809540dc87c665cafcd6daf514b39b4a17e483f.tar.gz
dna-backup-1809540dc87c665cafcd6daf514b39b4a17e483f.zip
remove merge and extract tempchunks
Diffstat (limited to 'repo.go')
-rw-r--r--repo.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/repo.go b/repo.go
index 1c1267c..c023568 100644
--- a/repo.go
+++ b/repo.go
@@ -511,47 +511,6 @@ func loadRecipe(path string) []Chunk {
return recipe
}
-// mergeTempChunks joins temporary partial chunks from an array of chunks if possible.
-// If a chunk is smaller than the size required to calculate a super-feature,
-// it is then appended to the previous consecutive temporary chunk if it exists.
-func (r *Repo) mergeTempChunks(chunks []Chunk) (ret []Chunk) {
- var prev *TempChunk
- var curr *TempChunk
- for _, c := range chunks {
- tmp, isTmp := c.(*TempChunk)
- if !isTmp {
- if prev != nil && curr.Len() <= sketch.SuperFeatureSize(r.chunkSize, r.sketchSfCount, r.sketchFCount) {
- prev.AppendFrom(curr.Reader())
- } else if curr != nil {
- ret = append(ret, curr)
- }
- ret = append(ret, c)
- curr = nil
- prev = nil
- } else {
- prev = curr
- curr = tmp
- if prev != nil {
- ret = append(ret, prev)
- }
- }
- }
- if curr != nil {
- ret = append(ret, curr)
- }
- return
-}
-
-func extractTempChunks(chunks []Chunk) (ret []*TempChunk) {
- for _, c := range chunks {
- tmp, isTmp := c.(*TempChunk)
- if isTmp {
- ret = append(ret, tmp)
- }
- }
- return
-}
-
func extractDeltaChunks(chunks []Chunk) (ret []*DeltaChunk) {
for _, c := range chunks {
tmp, isDelta := c.(*DeltaChunk)