This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 27bac45 Trivial refactoring: extract common variable
27bac45 is described below
commit 27bac45a4392abbe7cd2520c3d0a0669df946f08
Author: Daniel Sun <[email protected]>
AuthorDate: Thu Apr 16 19:04:53 2020 +0800
Trivial refactoring: extract common variable
---
src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
b/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
index 6741689..f0761e1 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
@@ -930,17 +930,19 @@ public abstract class Selector {
Class<?>[] pt = handle.type().parameterArray();
for (int i = 0; i < args.length; i++) {
Object arg = args[i];
+ Class<?> paramType = pt[i];
MethodHandle test;
+
if (arg == null) {
- test = IS_NULL.asType(MethodType.methodType(boolean.class,
pt[i]));
+ test = IS_NULL.asType(MethodType.methodType(boolean.class,
paramType));
if (LOG_ENABLED) LOG.info("added null argument check at
pos " + i);
} else {
Class<?> argClass = arg.getClass();
- if (pt[i].isPrimitive()) continue;
+ if (paramType.isPrimitive()) continue;
//if (Modifier.isFinal(argClass.getModifiers()) &&
TypeHelper.argumentClassIsParameterClass(argClass,pt[i])) continue;
test = SAME_CLASS.
bindTo(argClass).
- asType(MethodType.methodType(boolean.class,
pt[i]));
+ asType(MethodType.methodType(boolean.class,
paramType));
if (LOG_ENABLED) LOG.info("added same class check at pos "
+ i);
}
Class<?>[] drops = new Class[i];