From 9ac33a06bc9e679fa822223a0299b1c71229f6cd Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 13 Aug 2012 12:24:14 -0700 Subject: [PATCH] vocabs.cache: clear only the vocab that changed from vocab-file-contents. --- basis/vocabs/cache/cache.factor | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/basis/vocabs/cache/cache.factor b/basis/vocabs/cache/cache.factor index 0717074623..e77e8c5217 100644 --- a/basis/vocabs/cache/cache.factor +++ b/basis/vocabs/cache/cache.factor @@ -1,12 +1,17 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: assocs kernel namespaces memoize init sequences vocabs -vocabs.hierarchy vocabs.loader vocabs.metadata vocabs.refresh ; +vocabs.hierarchy vocabs.loader vocabs.metadata vocabs.refresh +words ; IN: vocabs.cache : reset-cache ( vocab -- ) - vocab-name root-cache get-global delete-at - \ vocab-file-contents reset-memoized + vocab-name + [ root-cache get-global delete-at ] + [ + \ vocab-file-contents "memoize" word-prop + [ drop [ first vocab-name ] [ = not ] bi* ] with assoc-filter! drop + ] bi \ all-vocabs-recursive reset-memoized \ all-authors reset-memoized \ all-tags reset-memoized ;