mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Switch to faster json library go-json and sonic
Former-commit-id: ab9b4723f1dcf79fe5c073fff4d86f4f6969edfd
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
package obialign
|
||||
|
||||
import "slices"
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"slices"
|
||||
)
|
||||
|
||||
func _Backtracking(pathMatrix []int, lseqA, lseqB int, path *[]int) []int {
|
||||
|
||||
needed := (lseqA + lseqB) * 2
|
||||
(*path) = (*path)[:0]
|
||||
cp := cap(*path)
|
||||
(*path) = slices.Grow((*path), needed)
|
||||
if cp < cap(*path) {
|
||||
log.Infof("Resized path from %d to %d\n", cp, cap(*path))
|
||||
}
|
||||
p := cap(*path)
|
||||
*path = (*path)[:p]
|
||||
|
||||
@@ -88,7 +95,5 @@ func _Backtracking(pathMatrix []int, lseqA, lseqB int, path *[]int) []int {
|
||||
(*path)[p] = 0
|
||||
}
|
||||
|
||||
*path = (*path)[p:cap((*path))]
|
||||
|
||||
return *path
|
||||
return (*path)[p:cap((*path))]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user