There was an error while loading. Please reload this page.
1 parent 1d90aff commit b8eb45cCopy full SHA for b8eb45c
tpl/collections/collections.go
@@ -539,8 +539,8 @@ type dKey struct {
539
// using J. S. Vitter's Method D for sequential random sampling, from Vitter, J.S.
540
// - An Efficient Algorithm for Sequential Random Sampling - ACM Trans. Math. Software 11 (1985), 37-57.
541
// See https://getkerf.wordpress.com/2016/03/30/the-best-algorithm-no-one-knows-about/
542
-func (ns *Namespace) D(seed, n, hi any) []int {
543
- key := dKey{seed: cast.ToUint64(seed), n: cast.ToInt(n), hi: cast.ToInt(hi)}
+func (ns *Namespace) D(seed, n, hi int) []int {
+ key := dKey{seed: cast.ToUint64(seed), n: n, hi: hi}
544
if key.n <= 0 || key.hi <= 0 || key.n > key.hi {
545
return nil
546
}
0 commit comments