[isidorus-cvs] r703 - trunk/src/json/isidorus-json
lgiessmann at common-lisp.net
lgiessmann at common-lisp.net
Tue Aug 2 12:17:52 UTC 2011
Author: lgiessmann
Date: Tue Aug 2 05:17:52 2011
New Revision: 703
Log:
trunk: improved the performance of 'get-all-psis'
Modified:
trunk/src/json/isidorus-json/json_exporter.lisp
Modified: trunk/src/json/isidorus-json/json_exporter.lisp
==============================================================================
--- trunk/src/json/isidorus-json/json_exporter.lisp Tue Aug 2 01:05:59 2011 (r702)
+++ trunk/src/json/isidorus-json/json_exporter.lisp Tue Aug 2 05:17:52 2011 (r703)
@@ -389,18 +389,14 @@
"returns all topic psis as a json list of the form
[[topic-1-psi-1, topic-1-psi-2],[topic-2-psi-1, topic-2-psi-2],...]"
(declare (type (or integer null) revision))
- (encode-json-to-string
- (remove-if #'null
- (map 'list
- #'(lambda(psi-list)
- (when psi-list
- (map 'list #'uri psi-list)))
- (map 'list #'psis
- (remove-null
- (map 'list #'(lambda(top)
- (when (find-item-by-revision top revision)
- top))
- (get-all-topics revision))))))))
+ (let ((psi-lists
+ (map 'list (lambda(top)
+ (when (d:find-item-by-revision top revision)
+ (let ((psis (d:psis top :revision revision)))
+ (when psis
+ (map 'list #'d:uri psis)))))
+ (elephant:get-instances-by-class 'd:TopicC))))
+ (json:encode-json-to-string (tools:remove-null psi-lists))))
(defun to-json-string-summary (topic &key (revision *TM-REVISION*))
More information about the Isidorus-cvs
mailing list