From 06781810236df440dc62fcdfb3ae10cc2d8bee6e Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Wed, 14 Jan 2026 17:46:26 +0100 Subject: [PATCH] Refactor chunk processing and update version commit Optimize chunk processing by moving variable declarations inside the loop and update the commit hash in version.go to reflect the latest changes. --- pkg/obichunk/chunk_on_disk.go | 18 +++++++++--------- pkg/obioptions/version.go | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/obichunk/chunk_on_disk.go b/pkg/obichunk/chunk_on_disk.go index 2a71c78..dd678f9 100644 --- a/pkg/obichunk/chunk_on_disk.go +++ b/pkg/obichunk/chunk_on_disk.go @@ -120,7 +120,6 @@ func ISequenceChunkOnDisk(iterator obiiter.IBioSequence, if dereplicate { u := make(map[string]*obiseq.BioSequence) var source string - var chunk obiseq.BioSequenceSlice for iseq.Next() { batch := iseq.Get() @@ -135,15 +134,16 @@ func ISequenceChunkOnDisk(iterator obiiter.IBioSequence, u[sstring] = seq } } - - chunk = obiseq.MakeBioSequenceSlice(len(u)) - i := 0 - - for _, seq := range u { - chunk[i] = seq - } - } + + chunk := obiseq.MakeBioSequenceSlice(len(u)) + i := 0 + + for _, seq := range u { + chunk[i] = seq + i++ + } + newIter.Push(obiiter.MakeBioSequenceBatch(source, order, chunk)) } else { diff --git a/pkg/obioptions/version.go b/pkg/obioptions/version.go index 0cbe8a9..4a91c52 100644 --- a/pkg/obioptions/version.go +++ b/pkg/obioptions/version.go @@ -8,7 +8,7 @@ import ( // corresponds to the last commit, and not the one when the file will be // commited -var _Commit = "547135c" +var _Commit = "f55dd55" var _Version = "Release 4.4.0" // Version returns the version of the obitools package.