Refactoring related to iterators

This commit is contained in:
2022-11-16 17:13:03 +01:00
parent 6f853da9df
commit 09fc426b67
29 changed files with 95 additions and 93 deletions

View File

@ -631,7 +631,7 @@ func (iterator IBioSequenceBatch) FilterOn(predicate obiseq.SequencePredicate,
return trueIter.Rebatch(size)
}
// Load every sequences availables from an IBioSequenceBatch iterator into
// Load all sequences availables from an IBioSequenceBatch iterator into
// a large obiseq.BioSequenceSlice.
func (iterator IBioSequenceBatch) Load() obiseq.BioSequenceSlice {
@ -656,12 +656,12 @@ func IBatchOver(data obiseq.BioSequenceSlice,
buffsize = sizes[1]
}
trueIter := MakeIBioSequenceBatch(buffsize)
newIter := MakeIBioSequenceBatch(buffsize)
trueIter.Add(1)
newIter.Add(1)
go func() {
trueIter.WaitAndClose()
newIter.WaitAndClose()
}()
go func() {
@ -673,12 +673,12 @@ func IBatchOver(data obiseq.BioSequenceSlice,
if next > ldata {
next = ldata
}
trueIter.Push(MakeBioSequenceBatch(batchid, data[i:next]))
newIter.Push(MakeBioSequenceBatch(batchid, data[i:next]))
batchid++
}
trueIter.Done()
newIter.Done()
}()
return trueIter
return newIter
}