Mercurial Hosting > luan
comparison src/luan/interp/FnCall.java @ 111:2428ecfed375
change LuanFunction.call() from returning Object[] to returning Object, to reduce garbage collection
git-svn-id: https://luan-java.googlecode.com/svn/trunk@112 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 23 May 2014 20:40:05 +0000 |
parents | 6ca02b188dba |
children | f5af13062b10 |
comparison
equal
deleted
inserted
replaced
110:7afa6df829f3 | 111:2428ecfed375 |
---|---|
16 this.fnExpr = fnExpr; | 16 this.fnExpr = fnExpr; |
17 this.args = args; | 17 this.args = args; |
18 this.fnName = fnExpr.se().text(); | 18 this.fnName = fnExpr.se().text(); |
19 } | 19 } |
20 | 20 |
21 @Override public Object[] eval(LuanStateImpl luan) throws LuanException { | 21 @Override public Object eval(LuanStateImpl luan) throws LuanException { |
22 return call( luan, fnExpr.eval(luan) ); | 22 return call( luan, fnExpr.eval(luan) ); |
23 } | 23 } |
24 | 24 |
25 private Object[] call(LuanStateImpl luan,Object o) throws LuanException { | 25 private Object call(LuanStateImpl luan,Object o) throws LuanException { |
26 if( o instanceof LuanFunction ) { | 26 if( o instanceof LuanFunction ) { |
27 LuanFunction fn = (LuanFunction)o; | 27 LuanFunction fn = (LuanFunction)o; |
28 return luan.bit(se).call( fn, fnName, args.eval(luan) ); | 28 return luan.bit(se).call( fn, fnName, args.eval(luan) ); |
29 } | 29 } |
30 Object h = luan.getHandler("__call",o); | 30 Object h = luan.getHandler("__call",o); |