aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-11-28 19:19:44 +0000
committerdos-reis <gdr@axiomatics.org>2011-11-28 19:19:44 +0000
commit68e2e8c03b04972293096a507a4923df76772e46 (patch)
tree5fd9216bf26c3406879b6f75a138030781296e9a /src/interp
parent76263e0ec3b3d0f39172ac4b84599b364d161d7a (diff)
downloadopen-axiom-68e2e8c03b04972293096a507a4923df76772e46.tar.gz
* 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.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot3
1 files changed, 3 insertions, 0 deletions
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