#REFACTORING
authorClaus Gittinger <cg@exept.de>
Fri, 22 Jan 2016 20:51:04 +0100
changeset 16063 bce10645c75d
parent 16062 17352a9e9eaa
child 16064 a770f72f3601
#REFACTORING class: Tools::MethodList changed: #selectedMethodsChanged
Tools__MethodList.st
--- a/Tools__MethodList.st	Fri Jan 22 20:50:38 2016 +0100
+++ b/Tools__MethodList.st	Fri Jan 22 20:51:04 2016 +0100
@@ -720,12 +720,12 @@
 
     methods := methodList ? #().
     methods size == 0 ifTrue:[
-	"/ this may happen during early startup,
-	"/ when invoked with a preset methodSelection,
-	"/ and the methodGenerator has not yet been setup
-	"/ to not clobber the selection, defer the update
-	"/ until the methodList arrives ...
-	^ self
+        "/ this may happen during early startup,
+        "/ when invoked with a preset methodSelection,
+        "/ and the methodGenerator has not yet been setup
+        "/ to not clobber the selection, defer the update
+        "/ until the methodList arrives ...
+        ^ self
     ].
 
     selectedMethodsHolder := self selectedMethods.
@@ -734,32 +734,33 @@
     "/ check if all is selected (likely)
     ((selectedMethods size == methodList size)
     and:[selectedMethods = methodList]) ifTrue:[
-	indices := (1 to:selectedMethods size)
+        indices := (1 to:selectedMethods size)
     ] ifFalse:[
-	selectedMethods size > 100 ifTrue:[
-	    "/ check if all is selected (likely)
-	    ((selectedMethods size == methodList size)
-	    and:[selectedMethods = methodList]) ifTrue:[
-		indices := (1 to:selectedMethods size)
-	    ] ifFalse:[
-		"/ for big collections, generate a reverse map
-		reverseMap := IdentityDictionary new.
-		methods keysAndValuesDo:[:idx :mthd | reverseMap at:mthd put:idx].
-		indices := selectedMethods collect:[:eachSelectedMethod |
-		    reverseMap at:eachSelectedMethod ifAbsent:0
-		]
-	    ]
-	] ifFalse:[
-	    indices := (selectedMethods ? #()) collect:[:eachSelectedMethod |
-		methods identityIndexOf:eachSelectedMethod.
-	    ]
-	].
-	indices := indices select:[:idx | idx ~= 0].
+        selectedMethods size > 100 ifTrue:[
+            "/ check if all is selected (likely)
+            ((selectedMethods size == methodList size)
+            and:[selectedMethods = methodList]) ifTrue:[
+                indices := (1 to:selectedMethods size)
+            ] ifFalse:[
+                "/ for big collections, generate a reverse map
+                reverseMap := IdentityDictionary new.
+                methods keysAndValuesDo:[:idx :mthd | reverseMap at:mthd put:idx].
+                indices := selectedMethods 
+                                collect:[:eachSelectedMethod |
+                                    reverseMap at:eachSelectedMethod ifAbsent:0]
+                                thenSelect:[:idx | idx ~~ 0]
+            ]
+        ] ifFalse:[
+            indices := (selectedMethods ? #()) 
+                            collect:[:eachSelectedMethod |
+                                methods identityIndexOf:eachSelectedMethod]
+                            thenSelect:[:idx | idx ~~ 0]
+        ].
     ].
 
     selectedMethodNameIndicesHolder := self selectedMethodNameIndices.
     selectedMethodNameIndicesHolder value ~= indices ifTrue:[
-	selectedMethodNameIndicesHolder value:indices.
+        selectedMethodNameIndicesHolder value:indices.
     ]
 !