gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] 23/42: dht/client: Re-indent.


From: gnunet
Subject: [gnunet-scheme] 23/42: dht/client: Re-indent.
Date: Sat, 10 Sep 2022 19:08:16 +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 4e6963a633af5e39d4456ee90b959219f4840646
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Fri Sep 9 17:25:33 2022 +0200

    dht/client: Re-indent.
    
    After the unification, there is less indentation, reducing the need to
    split over multiple lines.
---
 gnu/gnunet/dht/client.scm | 48 +++++++++++++++++++----------------------------
 1 file changed, 19 insertions(+), 29 deletions(-)

diff --git a/gnu/gnunet/dht/client.scm b/gnu/gnunet/dht/client.scm
index d4c32eb..2d0bc4f 100644
--- a/gnu/gnunet/dht/client.scm
+++ b/gnu/gnunet/dht/client.scm
@@ -763,10 +763,8 @@ code automatically tries to reconnect, so @var{connected} 
can be called after
 unique id @var{unique-id}.  If there is no such get operation, or the get
 operation is cancelled, return @code{#false} instead."
        ;; TODO: is the 'terminal-condition' case needed?
-       (maybe-ask* (loop:terminal-condition loop)
-                   (loop:control-channel loop)
-                   'request-search-result-iterator
-                   unique-id))
+       (maybe-ask* (loop:terminal-condition loop) (loop:control-channel loop)
+                   'request-search-result-iterator unique-id))
       (message-handlers
        (message-handler
        (type (symbol-value message-type msg:dht:monitor:get))
@@ -849,8 +847,7 @@ operation is cancelled, return @code{#false} instead."
         ;; Register the new get operation, such that we remember
         ;; where to send responses to.
         (let ((id->operation-map
-               (bbtree-set id->operation-map
-                           (get:unique-id get)
+               (bbtree-set id->operation-map (get:unique-id get)
                            ((if (get:linger? get)
                                 make-strong-reference
                                 make-weak-reference) get))))
@@ -860,9 +857,8 @@ operation is cancelled, return @code{#false} instead."
           (control loop old-id->operation-map id->operation-map)))
        (('stop-search! get)
         (let^ ((<-- (old-id->operation-map id->operation-map)
-                    (process-stop-search
-                     old-id->operation-map id->operation-map
-                     message-queue get)))
+                    (process-stop-search old-id->operation-map
+                                         id->operation-map message-queue get)))
               (control loop old-id->operation-map id->operation-map)))
        (('put! put)
         ;; Send the put operation to the DHT service.
@@ -871,32 +867,26 @@ operation is cancelled, return @code{#false} instead."
        ;; Send by @code{request-search-result-iterator}.
        (('request-search-result-iterator answer-box unique-id)
         (answer answer-box
-                (and=> (bbtree-ref id->operation-map unique-id)
-                       dereference))
+                (and=> (bbtree-ref id->operation-map unique-id) dereference))
         (continue/no-change))
        (('resend-old-operations!)
         ;; Restart old operations.  Only get operations need to be submitted
         ;; again.
         ;;
         ;; TODO: restarting monitoring operations
-        (let ((id->operation-map
-               (bbtree-fold
-                (lambda (id reference id->operation-map)
-                  (let^ ((! get (dereference reference))
-                         ;; If the (weak) reference is broken, that means
-                         ;; the operation is unreachable, so then there is
-                         ;; no point to resending the get operation.
-                         (? (not get)
-                            id->operation-map)
-                         (! id->operation-map
-                            (bbtree-set id->operation-map id reference)))
-                        (send-get! message-queue get)
-                        id->operation-map))
-                id->operation-map
-                old-id->operation-map))
-              ;; Free some memory.
-              (old-id->operation-map empty-bbtree))
-          (control loop old-id->operation-map id->operation-map)))
+        (control loop empty-bbtree
+                 (bbtree-fold
+                  (lambda (id reference id->operation-map)
+                    (let^ ((! get (dereference reference))
+                           ;; If the (weak) reference is broken, that means
+                           ;; the operation is unreachable, so then there is
+                           ;; no point to resending the get operation.
+                           (? (not get) id->operation-map)
+                           (! id->operation-map
+                              (bbtree-set id->operation-map id reference)))
+                          (send-get! message-queue get)
+                          id->operation-map))
+                  id->operation-map old-id->operation-map)))
        ;; Some handles became unreachable and can be cancelled.
        (('lost . lost)
         (let next ((lost lost) (old-id->operation-map old-id->operation-map)

-- 
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]