summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-03-17 16:55:00 +0530
committerArun Isaac2022-03-18 16:23:58 +0530
commit50898532c81654d834b1070b49d05c46e378a455 (patch)
tree10e354e617d42c9eeef4f13c72c161d552ab682a
parent0b24b0e3cf5e6b52c7f91506dbb2b5ede44fd9cb (diff)
downloadtissue-50898532c81654d834b1070b49d05c46e378a455.tar.gz
tissue-50898532c81654d834b1070b49d05c46e378a455.tar.lz
tissue-50898532c81654d834b1070b49d05c46e378a455.zip
issue: Refactor out repeated use of assq-ref.
* tissue/issue.scm (issues): Refactor out repeated use of assq-ref.
-rw-r--r--tissue/issue.scm23
1 files changed, 10 insertions, 13 deletions
diff --git a/tissue/issue.scm b/tissue/issue.scm
index fd6b3bf..5b44cd3 100644
--- a/tissue/issue.scm
+++ b/tissue/issue.scm
@@ -193,20 +193,17 @@ return #f."
(compose (tenumerate)
(tmap (match-lambda
((index . line)
- (let ((alist (call-with-input-string line read)))
+ (let* ((alist (call-with-input-string line read))
+ (author (assq-ref alist 'author))
+ (date (assq-ref alist 'author-date))
+ (relative-date (assq-ref alist 'author-relative-date)))
(when (zero? index)
- (hashtable-set! result 'last-updater
- (assq-ref alist 'author))
- (hashtable-set! result 'last-updated-date
- (unix-time->date (assq-ref alist 'author-date)))
- (hashtable-set! result 'last-updated-relative-date
- (assq-ref alist 'author-relative-date)))
- (hashtable-set! result 'creator
- (assq-ref alist 'author))
- (hashtable-set! result 'created-date
- (unix-time->date (assq-ref alist 'author-date)))
- (hashtable-set! result 'created-relative-date
- (assq-ref alist 'author-relative-date)))))))
+ (hashtable-set! result 'last-updater author)
+ (hashtable-set! result 'last-updated-date (unix-time->date date))
+ (hashtable-set! result 'last-updated-relative-date relative-date))
+ (hashtable-set! result 'creator author)
+ (hashtable-set! result 'created-date (unix-time->date date))
+ (hashtable-set! result 'created-relative-date relative-date))))))
rcount get-line port)))
"git" "log" "--follow"
(string-append "--format=format:("