mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Reducing memory allocation events
Former-commit-id: c94e79ba116464504580fc397270ead154063971
This commit is contained in:
@ -1,15 +1,14 @@
|
||||
package obialign
|
||||
|
||||
import "slices"
|
||||
|
||||
func _Backtracking(pathMatrix []int, lseqA, lseqB int, path *[]int) []int {
|
||||
|
||||
needed := (lseqA + lseqB) * 2
|
||||
|
||||
if needed > cap(*path) {
|
||||
*path = make([]int, 0, needed)
|
||||
}
|
||||
|
||||
*path = (*path)[:cap(*path)]
|
||||
(*path) = (*path)[:0]
|
||||
(*path) = slices.Grow((*path), needed)
|
||||
p := cap(*path)
|
||||
*path = (*path)[:p]
|
||||
|
||||
i := lseqA - 1
|
||||
j := lseqB - 1
|
||||
|
Reference in New Issue
Block a user