fix(muscript): skip unneeded decompile/recompile step and use getLast
This commit is contained in:
parent
21a7cfcc39
commit
b6e9923fcf
|
@ -44,7 +44,7 @@ public class Closure extends DynamicExpr {
|
|||
|
||||
@Override
|
||||
public DCallable get(Scope dataRoot) {
|
||||
return DFinal.of(getSignature(), args -> {
|
||||
return DFinal.of(getSignature(), null, args -> {
|
||||
// Compare with ExprGroup.get()
|
||||
int ac = args.size();
|
||||
int ae = boundArgs.size();
|
||||
|
@ -54,7 +54,7 @@ public class Closure extends DynamicExpr {
|
|||
Scope fork = dataRoot.fork();
|
||||
for (int i = 0; i < ae; i++) fork.set(boundArgs.get(i), args.get(i));
|
||||
if (variadic) {
|
||||
fork.set(boundArgs.get(boundArgs.size() - 1), IntStream.range(ae, ac)
|
||||
fork.set(boundArgs.getLast(), IntStream.range(ae, ac)
|
||||
.mapToObj(args::get)
|
||||
.toList());
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class Closure extends DynamicExpr {
|
|||
step.get(fork);
|
||||
}
|
||||
return fin.get(fork);
|
||||
}, this::toString);
|
||||
}, () -> this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user