]> gitweb.factorcode.org Git - factor.git/commitdiff
bloom-filters: fewer fried quots
authorAlec Berryman <alec@thened.net>
Sun, 10 May 2009 23:41:39 +0000 (19:41 -0400)
committerAlec Berryman <alec@thened.net>
Sun, 10 May 2009 23:41:39 +0000 (19:41 -0400)
extra/bloom-filters/bloom-filters.factor

index 46c2a3f8c198224474b377792931e696b89d5116..308d10ad84dea6ced01686dbc70bae2663cbc865 100644 (file)
@@ -84,10 +84,10 @@ ERROR: invalid-n-objects ;
 ! support it, and I haven't done my own, but we'll go with it anyway.
 !
 : size-bloom-filter ( error-rate number-objects -- number-hashes number-bits )
-    '[ _ _ bits-to-satisfy-error-rate ]
-    '[ dup _ call 2array smaller-second ]
-    '[ n-hashes-range identity-configuration _ reduce ]
-    call
+    [ n-hashes-range identity-configuration ] 2dip
+    '[ dup [ _ _ bits-to-satisfy-error-rate ]
+       call 2array smaller-second ]
+    reduce
     dup validate-sizes
     first2 ;