From e55119040c31bb0870e73679239c9cdebc78a14c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 15 Aug 2022 08:00:31 -0700 Subject: Simplify code in get-gerrit-comments. - Don't capture info into variables that are accessed only once and whose content is obvious *and* already named by the struct slot. --- ger2err | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/ger2err b/ger2err index 4452729..23f503a 100755 --- a/ger2err +++ b/ger2err @@ -78,29 +78,22 @@ (each ((cmt comments)) (let ((unresolved [cmt "unresolved"])) (when (or unresolved resolved-too) - (let* ((line (int-flo (or [cmt "line"] 0.0))) - (rng [cmt "range"]) - (endchr [rng "end_character"]) - (ps-num (int-flo [cmt "patch_set"])) - (auth [cmt "author"]) - (name [auth "name"]) - (username [auth "username"]) - (unresolved [cmt "unresolved"]) - (lines (spl "\n" [cmt "message"])) + (let* ((ps-num (int-flo [cmt "patch_set"])) (patch-set (or [ps-hash ps-num] (set [ps-hash ps-num] (new patch-set num ps-num)))) (file (or [patch-set.files path] (set [patch-set.files path] - (new file path path))))) + (new file path path)))) + (auth [cmt "author"])) (vec-push file.comments (new comment - line line - chr endchr + line (int-flo (or [cmt "line"] 0.0)) + chr [[cmt "range"] "end_character"] unresolved unresolved - user username - name name - lines lines))))))))) + user [auth "username"] + name [auth "name"] + lines (spl "\n" [cmt "message"])))))))))) (defun print-as-errors (patchset) (put-line `comments from patch set @{patchset.num}`) -- cgit v1.2.3