From 1809540dc87c665cafcd6daf514b39b4a17e483f Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Thu, 9 Sep 2021 14:01:00 +0200 Subject: remove merge and extract tempchunks --- repo.go | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'repo.go') 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) -- cgit v1.2.3