git.fiddlerwoaroof.com
Browse code

Clean up graph definition

Ed Langley authored on 12/07/2019 09:23:01
Showing 1 changed files
... ...
@@ -42,23 +42,24 @@
42 42
                                                                            #1#)))))
43 43
 
44 44
 (defmethod cl-dot:graph-object-points-to ((graph git-graph) (commit string))
45
-  (mapcar (lambda (c)
46
-            (setf (gethash (list commit c)
47
-                           (edge-cache graph))
48
-                  t)
49
-            c)
50
-          (remove-if (lambda (it)
51
-                       (gethash (list commit it)
52
-                                (edge-cache graph)))
53
-                     (mapcar (serapeum:op (subseq _ 0 7))
54
-                             (get-commit-parents (repo graph) commit)
55
-                             #+nil
56
-                             (loop
57
-                               for cur = (list commit) then parents
58
-                               for parents = (let ((f (get-commit-parents (repo graph) (car cur))))
59
-                                               f)
60
-                               until (or (not parents)
61
-                                         (cdr parents))
62
-                               finally (return (or parents
63
-                                                   (when (not (equal commit (car cur)))
64
-                                                     cur))))))))
45
+  #+nil
46
+  (loop
47
+    for cur = (list commit) then parents
48
+    for parents = (let ((f (get-commit-parents (repo graph) (car cur))))
49
+                    f)
50
+    until (or (not parents)
51
+              (cdr parents))
52
+    finally (return (or parents
53
+                        (when (not (equal commit (car cur)))
54
+                          cur))))
55
+
56
+  (funcall (data-lens:<>1 (data-lens:over (serapeum:op
57
+                                            (setf (gethash (list commit _1)
58
+                                                           (edge-cache graph))
59
+                                                  t)
60
+                                            _1))
61
+                          (data-lens:exclude (serapeum:op
62
+                                               (gethash (list commit _1)
63
+                                                        (edge-cache graph))))
64
+                          (data-lens:over (serapeum:op (subseq _ 0 7))))
65
+           (get-commit-parents (repo graph) commit)))