diff options
author | Andy Wingo <wingo@pobox.com> | 2009-12-11 21:51:02 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-12-12 00:10:35 +0100 |
commit | 492e7efe6d453d7ef45f333ff22fa4d3838425fa (patch) | |
tree | 145435cbcafe64de2ac673a90750b6f1fa7caa22 | |
parent | 5bb408ccaf61884078f787f748dab6146ab3bc96 (diff) | |
download | guile-492e7efe6d453d7ef45f333ff22fa4d3838425fa.tar.gz |
lame tweak to the inliner
* module/language/tree-il/inline.scm: Tweak to avoid a (if #t #t #f).
Yes, it's lame.
-rw-r--r-- | module/language/tree-il/inline.scm | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/module/language/tree-il/inline.scm b/module/language/tree-il/inline.scm index 517ff1bd5..fa1c1d565 100644 --- a/module/language/tree-il/inline.scm +++ b/module/language/tree-il/inline.scm @@ -77,20 +77,23 @@ ((memq memv) (pmatch args ((,k ,l) (guard (const? l) (list? (const-exp l))) - (let lp ((elts (const-exp l))) - (if (null? elts) - (make-const #f #f) - (make-conditional - src - (make-application - #f - (make-primitive-ref #f (case name - ((memq) 'eq?) - ((memv) 'eqv?) - (else (error "what")))) - (list k (make-const #f (car elts)))) - (make-const #f #t) - (lp (cdr elts)))))) + (if (null? (const-exp l)) + (make-const #f #f) + (let lp ((elts (const-exp l))) + (let ((test (make-application + #f + (make-primitive-ref #f (case name + ((memq) 'eq?) + ((memv) 'eqv?) + (else (error "what")))) + (list k (make-const #f (car elts)))))) + (if (null? (cdr elts)) + test + (make-conditional + src + test + (make-const #f #t) + (lp (cdr elts)))))))) (else #f))) |