From 68e2e8c03b04972293096a507a4923df76772e46 Mon Sep 17 00:00:00 2001
From: dos-reis <gdr@axiomatics.org>
Date: Mon, 28 Nov 2011 19:19:44 +0000
Subject: 	* interp/c-util.boot (inlineDirectCall): Inline a non-side
 effect 	free argument in a unary pure function call if it is used
 exactly once. 	* algebra/integer.spad.pamphlet (Integer) [reducedSystem]: Fix
 typo.

---
 src/interp/c-util.boot | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/interp')

diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index e9643db3..5cd74206 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1321,6 +1321,9 @@ inlineDirectCall call ==
       newparms := [gensym() for p in parms]
       body := applySubst(pairList(parms,newparms),body)
       applySubst!(pairList(newparms,call.args),body)
+    -- a non-side effect free argument used exactly once is OK.
+    parms is [p] and numOfOccurencesOf(p,body) = 1 =>
+      substitute(first call.args,p,body)
     -- get cute later.
     call
   call
-- 
cgit v1.2.3