Skip to content

Commit e66817e

Browse files
pjstadigstuarthalloway
authored andcommitted
Do not hold onto head when invoking multi-methods
Signed-off-by: Stuart Halloway <[email protected]>
1 parent 4cba191 commit e66817e

File tree

2 files changed

+238
-34
lines changed

2 files changed

+238
-34
lines changed

src/jvm/clojure/lang/AFn.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ static public Object applyToHelper(IFn ifn, ISeq arglist) throws Exception{
158158
arglist = null;
159159
return ifn.invoke();
160160
case 1:
161-
Object a1 = arglist.first();
162-
arglist = null;
163-
return ifn.invoke(a1);
161+
return ifn.invoke(Util.ret1(arglist.first(),arglist = null));
164162
case 2:
165163
return ifn.invoke(arglist.first()
166164
, Util.ret1((arglist = arglist.next()).first(),arglist = null)

0 commit comments

Comments
 (0)