Optimize argument array creation in reflection call
This commit is contained in:
@@ -95,7 +95,7 @@ internal abstract class FunctionCaller<out M : Member>(
|
|||||||
class InstanceMethod(method: ReflectMethod) : Method(method) {
|
class InstanceMethod(method: ReflectMethod) : Method(method) {
|
||||||
override fun call(args: Array<*>): Any? {
|
override fun call(args: Array<*>): Any? {
|
||||||
checkArguments(args)
|
checkArguments(args)
|
||||||
return callMethod(args[0], args.asList().subList(1, args.size).toTypedArray())
|
return callMethod(args[0], args.copyOfRange(1, args.size))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ internal abstract class FunctionCaller<out M : Member>(
|
|||||||
override fun call(args: Array<*>): Any? {
|
override fun call(args: Array<*>): Any? {
|
||||||
checkArguments(args)
|
checkArguments(args)
|
||||||
checkObjectInstance(args.firstOrNull())
|
checkObjectInstance(args.firstOrNull())
|
||||||
return callMethod(null, args.asList().subList(1, args.size).toTypedArray())
|
return callMethod(null, args.copyOfRange(1, args.size))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user