--- 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.
].