diff --git a/core/hashtables/hashtables.factor b/core/hashtables/hashtables.factor index 7d8c6f0b5f..1fabc1aab7 100755 --- a/core/hashtables/hashtables.factor +++ b/core/hashtables/hashtables.factor @@ -95,11 +95,12 @@ IN: hashtables [ swap pick (set-hash) drop f ] find-pair 2drop 2drop ; : hash-large? ( hash -- ? ) - dup hash-count 3 fixnum*fast - swap hash-array array-capacity > ; + [ hash-count 3 fixnum*fast ] + [ hash-array array-capacity ] bi > ; : hash-stale? ( hash -- ? ) - dup hash-deleted 10 fixnum*fast swap hash-count fixnum> ; + [ hash-deleted 10 fixnum*fast ] + [ hash-count ] bi fixnum> ; : grow-hash ( hash -- ) [ dup hash-array swap assoc-size 1+ ] keep @@ -183,10 +184,13 @@ M: hashtable assoc-like [ 3drop ] [ dupd dupd set-at swap push ] if ; inline : prune ( seq -- newseq ) - dup length over length - rot [ >r 2dup r> (prune) ] each nip ; + [ length ] + [ length ] + [ ] tri + [ >r 2dup r> (prune) ] each nip ; : all-unique? ( seq -- ? ) - dup prune [ length ] 2apply = ; + [ length ] + [ prune length ] bi = ; INSTANCE: hashtable assoc diff --git a/extra/random/random-docs.factor b/extra/random/random-docs.factor index 905f81b53d..a8a214dcc7 100644 --- a/extra/random/random-docs.factor +++ b/extra/random/random-docs.factor @@ -17,7 +17,7 @@ HELP: random-32* { $description "Generates a random 32-bit unsigned integer." } ; HELP: random-bytes* -{ $values { "n" "an integer" } { "tuple" "a random number generator" } { "bytes" "a sequence of random bytes" } } +{ $values { "n" "an integer" } { "tuple" "a random number generator" } { "byte-array" "a sequence of random bytes" } } { $description "Generates a byte-array of random bytes." } ; HELP: random @@ -26,7 +26,7 @@ HELP: random { $notes "Since integers are sequences, passing an integer " { $snippet "n" } " yields a random integer in the interval " { $snippet "[0,n)" } "." } ; HELP: random-bytes -{ $values { "n" "an integer" } { "bytes" "a random integer" } } +{ $values { "n" "an integer" } { "byte-array" "a random integer" } } { $description "Outputs an integer with n bytes worth of bits." } ; HELP: random-bits