mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Genericise sliceutil functions (#4253)
* Genericise sliceutil.SliceSame * Genericise intslice functions * Genericise stringutil functions
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/stashapp/stash/pkg/sliceutil/stringslice"
|
||||
"github.com/stashapp/stash/pkg/sliceutil"
|
||||
)
|
||||
|
||||
// only keep the 10 most recent IP addresses
|
||||
@@ -30,7 +30,7 @@ func (m *ipWhitelistManager) addRecent(addr string) bool {
|
||||
m.mutex.Lock()
|
||||
defer m.mutex.Unlock()
|
||||
|
||||
i := stringslice.StrIndex(m.recentIPAddresses, addr)
|
||||
i := sliceutil.Index(m.recentIPAddresses, addr)
|
||||
if i != -1 {
|
||||
if i == 0 {
|
||||
// don't do anything if it's already at the start
|
||||
|
||||
Reference in New Issue
Block a user