fix #74: warn if about to write to already visited ad, overwrite if -f

This commit is contained in:
2024-02-10 14:06:06 +01:00
committed by T.v.Dein
parent ed78731b3c
commit 612ed2aa79
11 changed files with 54 additions and 8 deletions

View File

@@ -74,3 +74,12 @@ func IsNoTty() bool {
func GetThrottleTime() time.Duration {
return time.Duration(rand.Intn(MaxThrottle-MinThrottle+1)+MinThrottle) * time.Millisecond
}
// look if a key in a map exists, generic variant
func Exists[K comparable, V any](m map[K]V, v K) bool {
if _, ok := m[v]; ok {
return true
}
return false
}