Skip to content

Commit 8c2dd86

Browse files
committed
Fixed results-generator
1 parent 7cc1ff3 commit 8c2dd86

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

DiffBackend/src/results-generator.lisp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010

1111
(in-package :diff-backend/results-generator)
1212

13+
(defmacro add-to-ht (key value)
14+
`(setf (gethash ,key ht) ,value))
15+
16+
(defmacro with-ht (&body body)
17+
`(let ((ht (make-hash-table :test #'equal)))
18+
(progn
19+
,@body)
20+
ht))
21+
1322
(defun get-json-res (obj stream)
1423
(encode-json (gener-res-object obj) stream))
1524

@@ -24,20 +33,11 @@
2433
(encode-json
2534
(with-ht
2635
(loop :for line-num :being :the :hash-key :in comment-table :using (:hash-value val)
27-
:do (add-to-ht line-num (alexandria:plist-hash-table val))))
36+
:do (setf (gethash line-num ht) (alexandria:plist-hash-table val))))
2837
stream))
2938

3039
(defgeneric gener-res-object (obj))
3140

32-
(defmacro add-to-ht (key value)
33-
`(setf (gethash ,key ht) ,value))
34-
35-
(defmacro with-ht (&body body)
36-
`(let ((ht (make-hash-table :test #'equal)))
37-
(progn
38-
,@body)
39-
ht))
40-
4141
(defmethod gener-res-object ((obj defun-node))
4242
(with-ht
4343
(add-to-ht "type" "list")

0 commit comments

Comments
 (0)