diff options
-rw-r--r-- | mumi/messages.scm | 13 | ||||
-rw-r--r-- | mumi/xapian.scm | 21 |
2 files changed, 15 insertions, 19 deletions
diff --git a/mumi/messages.scm b/mumi/messages.scm index b3ae962..fd52571 100644 --- a/mumi/messages.scm +++ b/mumi/messages.scm @@ -64,15 +64,10 @@ (define (status-with-cache ids) "Invoke GET-STATUS, but only on those IDS that have not been cached yet. Return new results alongside cached results." - (let* ((cached (filter-map cached? ids)) - (uncached-ids (lset-difference eq? - ids - (map bug-num cached))) - (new (filter-map bug-status uncached-ids ))) - ;; Cache new things - (map (lambda (bug) (cache! (bug-num bug) bug)) new) - ;; Return everything from cache - (sort (append cached new) (lambda (a b) (< (bug-num a) (bug-num b)))))) + (map (lambda (id) + (or (cached? id) + (cache! id (bug-status id)))) + ids)) (define (extract-name address) (or (assoc-ref address 'name) diff --git a/mumi/xapian.scm b/mumi/xapian.scm index ae01acc..7ca5bb8 100644 --- a/mumi/xapian.scm +++ b/mumi/xapian.scm @@ -339,16 +339,17 @@ intact." ;; Collapse on mergedwith value (Enquire-set-collapse-key enq 2 1) ;; Fold over the results, return bug id. - (mset-fold (lambda (item acc) - (cons - (document-data (mset-item-document item)) - acc)) - '() - ;; Get an Enquire object from the database with the - ;; search results. Then, extract the MSet from the - ;; Enquire object. - (enquire-mset enq - #:maximum-items pagesize)))))) + (reverse + (mset-fold (lambda (item acc) + (cons + (document-data (mset-item-document item)) + acc)) + '() + ;; Get an Enquire object from the database with the + ;; search results. Then, extract the MSet from the + ;; Enquire object. + (enquire-mset enq + #:maximum-items pagesize))))))) (define* (index! #:key full?) "Index all Debbugs log files corresponding to the selected |