]> gitweb.factorcode.org Git - factor.git/commitdiff
checksums.multi: fix $slot help-lint error.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 5 Mar 2018 01:47:01 +0000 (17:47 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 5 Mar 2018 01:47:01 +0000 (17:47 -0800)
extra/checksums/multi/multi-docs.factor
extra/checksums/multi/multi.factor

index cb4304c4a700e0fb20fe87fde9034fd052e86a82..26ea2abad84d63f1c1d4a4a9bbb6dd65d9c12b63 100644 (file)
@@ -54,7 +54,7 @@ HELP: multi-checksum
 { $class-description "This is an instance of the " { $link block-checksum } " mixin. It calculates multiple checksums by sequentially passing the data it receives to all the checksums in its " { $slot "checksums" } " slot. This way, even though the individual checksums are not calculated in parallel, you still can have the performance benefits of only reading a disk file once, or not having to temporarily store the data streamed from a network." } ;
 
 HELP: multi-state
-{ $class-description "This class represents the current state of a " { $link multi-checksum } " checksum calculation. It has an array of associated checksum states until it is disposed. You may call " { $link add-checksum-bytes } " multiple times to pipe data to all the checksums in the " { $slot "checksums" } " slot. When finished, call " { $link get-checksum } " to receive the results and release implementation-specific resources, or " { $link dispose } " to release the resources and discard the result. After the first " { $link get-checksum } " call the returned value is stored in the " { $slot "results" } " slot, and subsequent calls return the same value." }
+{ $class-description "This class represents the current state of a " { $link multi-checksum } " checksum calculation. It has an array of associated checksum states until it is disposed. You may call " { $link add-checksum-bytes } " multiple times to pipe data to all the checksum states in the " { $slot "states" } " slot. When finished, call " { $link get-checksum } " to receive the results and release implementation-specific resources, or " { $link dispose } " to release the resources and discard the result. After the first " { $link get-checksum } " call the returned value is stored in the " { $slot "results" } " slot, and subsequent calls return the same value." }
 { $notes "It is not possible to add more data to the checksum after the first " { $link get-checksum } " call."
 $nl
 "Most code should use " { $link with-checksum-state } " to make sure the resources are properly disposed of. Higher level words like " { $link checksum-bytes } " and " { $link checksum-stream } " use it to perform the disposal." } ;
index 08d8143bfab3537aaacd0d46443468342d547db1..6a89098db9f752e17376d14e317d2cb3ac0e1780 100644 (file)
@@ -1,17 +1,17 @@
 ! Copyright (C) 2018 Alexander Ilin.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors checksums checksums.common destructors fry kernel
-sequences ;
+USING: accessors checksums checksums.common destructors fry
+kernel sequences ;
 IN: checksums.multi
 
 TUPLE: multi-checksum checksums ;
-INSTANCE: multi-checksum block-checksum
+
 C: <multi-checksum> multi-checksum
 
 TUPLE: multi-state < disposable states results ;
 
 M: multi-checksum initialize-checksum-state
-    checksums>> [ initialize-checksum-state ] V{ } map-as
+    checksums>> [ initialize-checksum-state ] map
     multi-state new-disposable swap >>states ;
 
 M: multi-state dispose*
@@ -22,5 +22,7 @@ M: multi-state add-checksum-bytes
 
 M: multi-state get-checksum
     dup results>> [
-        dup states>> [ get-checksum ] { } map-as [ >>results ] keep
+        dup states>> [ get-checksum ] map [ >>results ] keep
     ] unless* nip ;
+
+INSTANCE: multi-checksum block-checksum