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 163f737d1c Trivial refactor: extract variable to avoid invoking same
method repeatedly
163f737d1c is described below
commit 163f737d1c90d8fb9bd787b0ae71fc6403a22e0f
Author: Daniel Sun <[email protected]>
AuthorDate: Sat May 24 17:59:27 2025 +0900
Trivial refactor: extract variable to avoid invoking same method repeatedly
---
src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java | 5 +++--
1 file changed, 3 insertions(+), 2 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 8d7ea2c196..f173e9df8d 100644
--- a/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
+++ b/src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java
@@ -323,10 +323,11 @@ public abstract class Selector {
selectionBase = sender;
if (sender != mci.getTheClass()) {
+ final Class<?> thisType;
if (GroovyCategorySupport.hasCategoryInCurrentThread()) { //
slow path for category property
selectionBase = mci.getTheClass();
- } else if (getThisType(sender).isInstance(receiver)) { //
GROOVY-5438 for private property
- selectionBase = getThisType(sender);
+ } else if ((thisType =
getThisType(sender)).isInstance(receiver)) { // GROOVY-5438 for private property
+ selectionBase = thisType;
}
}
if (LOG_ENABLED) LOG.info("selectionBase set to " + selectionBase);