From 9736acaa5b4a02ceb75d33d78403a019b43dccf1 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 11 Sep 2019 05:00:11 -0700 Subject: [PATCH] tools.crossref: faster M\ link uses by calling article-content once. --- basis/tools/crossref/crossref.factor | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/basis/tools/crossref/crossref.factor b/basis/tools/crossref/crossref.factor index c7098fc366..43e7a1c9a2 100644 --- a/basis/tools/crossref/crossref.factor +++ b/basis/tools/crossref/crossref.factor @@ -47,11 +47,13 @@ M: callable uses ( quot -- seq ) M: word uses def>> uses ; M: link uses - [ { $subsection $subsections $link $see-also } article-links [ >link ] map ] - [ { $vocab-link } article-links [ >vocab-link ] map ] + article-content + [ { $subsection $subsections $link $see-also } collect-elements [ >link ] map ] + [ { $vocab-link } collect-elements [ >vocab-link ] map ] bi append ; -M: pathname uses string>> path>source-file top-level-form>> [ uses ] [ { } ] if* ; +M: pathname uses + string>> path>source-file top-level-form>> [ uses ] [ { } ] if* ; ! To make UI browser happy M: object uses drop f ; @@ -140,7 +142,7 @@ M: f smart-usage drop \ f smart-usage ; SINGLETON: invalidate-crossref M: invalidate-crossref definitions-changed - 2drop crossref global delete-at ; + 2drop f crossref set-global ; [ invalidate-crossref add-definition-observer ] "tools.crossref" add-startup-hook