mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-11-10 01:24:41 +00:00
Use NewBioSequenceOwning to avoid unnecessary sequence copying
Replace NewBioSequence with NewBioSequenceOwning in genbank_read.go to take ownership of sequence slices without copying, improving performance. Update biosequence.go to add the new TakeSequence method and NewBioSequenceOwning constructor.
This commit is contained in:
1 parent
b246025907
commit
1342c83db6
2 files changed
+21
-2
No files matched your search
@@ -287,7 +287,7 @@ func GenbankChunkParserRope(source string, rope *PieceOfChunk,
|
||||
if id == "" {
|
||||
log.Warn("Empty id when parsing genbank file")
|
||||
}
|
||||
sequence := obiseq.NewBioSequence(id, seqDest, defBytes.String())
|
||||
sequence := obiseq.NewBioSequenceOwning(id, seqDest, defBytes.String())
|
||||
sequence.SetSource(source)
|
||||
if withFeatureTable {
|
||||
sequence.SetFeatures(featBytes.Bytes())
|
||||
@@ -320,7 +320,7 @@ func GenbankChunkParserRope(source string, rope *PieceOfChunk,
|
||||
if id == "" {
|
||||
log.Warn("Empty id when parsing genbank file")
|
||||
}
|
||||
sequence := obiseq.NewBioSequence(id, seqDest, defBytes.String())
|
||||
sequence := obiseq.NewBioSequenceOwning(id, seqDest, defBytes.String())
|
||||
sequence.SetSource(source)
|
||||
if withFeatureTable {
|
||||
sequence.SetFeatures(featBytes.Bytes())
|
||||
|
||||
Reference in new issue
Block a user