remove the slice pool management

This commit is contained in:
Eric Coissac
2024-09-24 16:31:30 +02:00
parent 2b4a633c30
commit 241f2286f2
17 changed files with 23 additions and 84 deletions

View File

@@ -64,6 +64,7 @@ type BioSequence struct {
qualities []byte // The quality scores of the sequence.
feature []byte
paired *BioSequence // A pointer to the paired sequence
revcomp *BioSequence // A pointer to the reverse complemented sequence
annotations Annotation
annot_lock *sync.Mutex
}
@@ -78,7 +79,8 @@ func NewEmptyBioSequence(preallocate int) *BioSequence {
seq := []byte(nil)
if preallocate > 0 {
seq = GetSlice(preallocate)
// seq = GetSlice(preallocate)
seq = make([]byte, 0, preallocate)
}
return &BioSequence{
@@ -89,6 +91,7 @@ func NewEmptyBioSequence(preallocate int) *BioSequence {
qualities: nil,
feature: nil,
paired: nil,
revcomp: nil,
annotations: nil,
annot_lock: &sync.Mutex{},
}
@@ -426,9 +429,6 @@ func (s *BioSequence) SetFeatures(feature []byte) {
// Parameters:
// - sequence: a byte slice representing the sequence to be set.
func (s *BioSequence) SetSequence(sequence []byte) {
if s.sequence != nil {
RecycleSlice(&s.sequence)
}
s.sequence = obiutils.InPlaceToLower(CopySlice(sequence))
}