gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 185/324: tests/utils: Use set-value! instead of hashtabl


From: gnunet
Subject: [gnunet-scheme] 185/324: tests/utils: Use set-value! instead of hashtable-set!.
Date: Tue, 21 Sep 2021 13:23:45 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 4145b464536e599d6052da48a573a29e6ffc901c
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Aug 14 21:40:34 2021 +0200

    tests/utils: Use set-value! instead of hashtable-set!.
    
    This simplifies the code a little.
    
    * tests/utils.scm (call-with-services): Use set-value! instead
      of hashtable-set!.
---
 tests/utils.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/utils.scm b/tests/utils.scm
index 1f711be..1a0818b 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -23,7 +23,8 @@
                #:select (bitwise-ior))
   #:use-module ((rnrs base) #:select (assert))
   #:use-module ((fibers) #:prefix #{fibers:}#)
-  #:autoload (gnu gnunet config db) (hash->configuration hash-key key=?)
+  #:autoload (gnu gnunet config db)
+  (hash->configuration hash-key key=? set-value!)
   #:export (conservative-gc? calls-in-tail-position?
                             call-with-services
                             call-with-services/fibers))
@@ -96,13 +97,13 @@ the services and each tails is a list of a procedure 
accepting ports
             (raise-exception e))
         thunk)))
     (values))
-  (define config-hash (rnrs:make-hashtable hash-key key=?))
+  (define config (hash->configuration
+                 (rnrs:make-hashtable hash-key key=?)))
   (call-with-temporary-directory
    (lambda (dir)
      (define (start-service key+value)
        (define where (in-vicinity dir (string-append (car key+value) ".sock")))
-       (rnrs:hashtable-set! config-hash (cons (car key+value) "UNIXPATH")
-                           where)
+       (set-value! identity config (car key+value) "UNIXPATH" where)
        (wrapped-spawn-fiber
        (lambda ()
          (define sock (socket AF_UNIX SOCK_STREAM 0))
@@ -119,7 +120,6 @@ the services and each tails is a list of a procedure 
accepting ports
               ((cdr key+value) client-sock wrapped-spawn-fiber)))
            (loop)))))
      (for-each start-service service-alist)
-     (define config (hash->configuration config-hash))
      (call-with-values
         (lambda () (proc config wrapped-spawn-fiber))
        (lambda results

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]