Skip to content

Commit 163f737

Browse files
committed
Trivial refactor: extract variable to avoid invoking same method repeatedly
1 parent fdfd3fa commit 163f737

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/org/codehaus/groovy/vmplugin/v8/Selector.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,11 @@ public void chooseMeta(MetaClassImpl mci) {
323323

324324
selectionBase = sender;
325325
if (sender != mci.getTheClass()) {
326+
final Class<?> thisType;
326327
if (GroovyCategorySupport.hasCategoryInCurrentThread()) { // slow path for category property
327328
selectionBase = mci.getTheClass();
328-
} else if (getThisType(sender).isInstance(receiver)) { // GROOVY-5438 for private property
329-
selectionBase = getThisType(sender);
329+
} else if ((thisType = getThisType(sender)).isInstance(receiver)) { // GROOVY-5438 for private property
330+
selectionBase = thisType;
330331
}
331332
}
332333
if (LOG_ENABLED) LOG.info("selectionBase set to " + selectionBase);

0 commit comments

Comments
 (0)