Genericise sliceutil functions (#4253)

* Genericise sliceutil.SliceSame
* Genericise intslice functions
* Genericise stringutil functions
This commit is contained in:
DingDongSoLong4
2023-11-01 23:58:32 +02:00
committed by GitHub
parent cc6673f276
commit 9621213424
51 changed files with 259 additions and 409 deletions

View File

@@ -5,7 +5,7 @@ import (
"strconv"
"github.com/corona10/goimagehash"
"github.com/stashapp/stash/pkg/sliceutil/intslice"
"github.com/stashapp/stash/pkg/sliceutil"
)
type Phash struct {
@@ -58,7 +58,7 @@ func findNeighbors(bucket int, neighbors []int, hashes []*Phash, scenes *[]int)
hash := hashes[id]
if hash.Bucket == -1 {
hash.Bucket = bucket
*scenes = intslice.IntAppendUnique(*scenes, hash.SceneID)
*scenes = sliceutil.AppendUnique(*scenes, hash.SceneID)
findNeighbors(bucket, hash.Neighbors, hashes, scenes)
}
}