#TUNING by exept cvs_MAIN
authorClaus Gittinger <cg@exept.de>
Sun, 08 Sep 2019 15:28:14 +0200
branchcvs_MAIN
changeset 3954 442e855aa6a7
parent 3953 38a940b3b7b6
child 3955 d68f9d811e27
#TUNING by exept class: JavaLookup::Smalltalk2Java changed: #findBestMatchOf:in:
JavaLookup.st
--- a/JavaLookup.st	Sun Sep 08 15:27:59 2019 +0200
+++ b/JavaLookup.st	Sun Sep 08 15:28:14 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  Copyright (c) 2010-2011 Jan Vrany, Jan Kurs & Marcel Hlopko,
                          SWING Research Group, Czech Technical University 
@@ -641,29 +643,28 @@
 !
 
 findBestMatchOf: smalltalkMethod in: javaMethods
-    | methods |
-    javaMethods size = 1 ifTrue: [
+    | methods numJavaMethods numMethods|
+
+    numJavaMethods := javaMethods size.
+    numJavaMethods == 1 ifTrue: [
         ^ javaMethods first.    
     ].
-    javaMethods size = 0 ifTrue: [
+    numJavaMethods == 0 ifTrue: [
         ^ nil
     ].
 
-    methods := javaMethods select: [:m |
-        m argSize = smalltalkMethod argSize.
-    ].
-    methods size = 1 ifTrue: [
+    methods := javaMethods select: [:m | m argSize = smalltalkMethod argSize].
+    numMethods := methods size.
+    numMethods == 1 ifTrue: [
         ^ methods first.    
     ].
 
-    methods := methods select: [:m |
-        self javaMatches: m argTypes to: smalltalkMethod args.
-    ].
-    methods size = 1 ifTrue: [
+    methods := methods select: [:m | self javaMatches: m argTypes to: smalltalkMethod args].
+    numMethods := methods size.
+    numMethods == 1 ifTrue: [
         ^ methods first.
     ].
-
-    methods size = 0 ifTrue: [
+    numMethods == 0 ifTrue: [
         ^ nil.
     ].