From ef4d47c67af8d172f368812168c8303b860fa3bb Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sat, 14 Jun 2014 14:20:23 -0400 Subject: [PATCH] Remove silly identity-projection efficiency hack. --- minimart/gestalt.rkt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/minimart/gestalt.rkt b/minimart/gestalt.rkt index a266f01..9c07f1c 100644 --- a/minimart/gestalt.rkt +++ b/minimart/gestalt.rkt @@ -127,21 +127,13 @@ (define (compile-gestalt-projection . specs) (compile-gestalt-projection* specs)) -;; CompiledProjection -;; Represents a projection that simply captures the entirety of the -;; projected matcher; useful as an identity projection. -(define capture-everything-projection (compile-gestalt-projection (?!))) - ;; Gestalt × Natural × Natural × Boolean × CompiledProjection → Matcher ;; Retrieves the Matcher within g at the given metalevel and level, ;; representing subscriptions or advertisements, projected by capture-spec. (define (gestalt-project g metalevel level get-advertisements? capture-spec) (define extract-matcher (if get-advertisements? cdr car)) (define l (safe-list-ref (gestalt-metalevel-ref g metalevel) level (lambda () empty-level))) - (define matcher (extract-matcher l)) - (if (equal? capture-spec capture-everything-projection) ;; efficiency hack. Avoid projecting by identity - matcher - (matcher-project matcher capture-spec))) + (matcher-project (extract-matcher l) capture-spec)) ;; Gestalt -> Gestalt ;; Discards the 0th metalevel, renumbering others appropriately.