mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
remove the slice pool management
This commit is contained in:
@ -108,14 +108,3 @@ func (batch BioSequenceBatch) Pop0() *obiseq.BioSequence {
|
||||
func (batch BioSequenceBatch) IsNil() bool {
|
||||
return batch.slice == nil
|
||||
}
|
||||
|
||||
// Recycle cleans up the BioSequenceBatch by recycling its elements and resetting its slice.
|
||||
//
|
||||
// If including_seq is true, each element of the BioSequenceBatch's slice is recycled using the Recycle method,
|
||||
// and then set to nil. If including_seq is false, each element is simply set to nil.
|
||||
//
|
||||
// This function does not return anything.
|
||||
func (batch BioSequenceBatch) Recycle(including_seq bool) {
|
||||
batch.slice.Recycle(including_seq)
|
||||
batch.slice = nil
|
||||
}
|
||||
|
@ -459,7 +459,6 @@ func (iterator IBioSequence) Rebatch(size int) IBioSequence {
|
||||
}
|
||||
i += to_push
|
||||
}
|
||||
seqs.Recycle(false)
|
||||
}
|
||||
log.Debug("End of the rebatch loop")
|
||||
if len(buffer) > 0 {
|
||||
@ -521,7 +520,6 @@ func (iterator IBioSequence) Recycle() {
|
||||
o := batch.Order()
|
||||
log.Debugln("Recycling batch #", o)
|
||||
recycled += batch.Len()
|
||||
batch.Recycle(true)
|
||||
log.Debugln("Batch #", o, " recycled")
|
||||
}
|
||||
log.Debugf("End of the recycling of %d Bioseq objects", recycled)
|
||||
@ -529,8 +527,7 @@ func (iterator IBioSequence) Recycle() {
|
||||
|
||||
func (iterator IBioSequence) Consume() {
|
||||
for iterator.Next() {
|
||||
batch := iterator.Get()
|
||||
batch.Recycle(false)
|
||||
iterator.Get()
|
||||
}
|
||||
}
|
||||
|
||||
@ -548,7 +545,6 @@ func (iterator IBioSequence) Count(recycle bool) (int, int, int) {
|
||||
reads += seq.Count()
|
||||
nucleotides += seq.Len()
|
||||
}
|
||||
batch.Recycle(recycle)
|
||||
}
|
||||
log.Debugf("End of the counting of %d Bioseq objects", variants)
|
||||
return variants, reads, nucleotides
|
||||
@ -602,7 +598,6 @@ func (iterator IBioSequence) DivideOn(predicate obiseq.SequencePredicate,
|
||||
falseSlice = obiseq.MakeBioSequenceSlice()
|
||||
}
|
||||
}
|
||||
seqs.Recycle(false)
|
||||
}
|
||||
|
||||
if len(trueSlice) > 0 {
|
||||
@ -749,7 +744,6 @@ func (iterator IBioSequence) Load() (string, obiseq.BioSequenceSlice) {
|
||||
}
|
||||
log.Debugf("append %d sequences", b.Len())
|
||||
chunk = append(chunk, b.Slice()...)
|
||||
b.Recycle(false)
|
||||
}
|
||||
|
||||
return source, chunk
|
||||
|
@ -93,7 +93,6 @@ func (iterator IBioSequence) Distribute(class *obiseq.BioSequenceClassifier, siz
|
||||
slices[key] = &s
|
||||
}
|
||||
}
|
||||
seqs.Recycle(false)
|
||||
}
|
||||
|
||||
for key, slice := range slices {
|
||||
|
@ -55,7 +55,6 @@ func IFragments(minsize, length, overlap, size, nworkers int) Pipeable {
|
||||
}
|
||||
} // End of the slice loop
|
||||
newiter.Push(MakeBioSequenceBatch(source, sl.Order(), news))
|
||||
sl.Recycle(false)
|
||||
} // End of the iterator loop
|
||||
|
||||
// if len(news) > 0 {
|
||||
|
Reference in New Issue
Block a user