Refactoring:
authorStefan Vogel <sv@exept.de>
Tue, 02 Apr 2013 11:32:45 +0200
changeset 3058 2709dcc6f01a
parent 3057 565306c68efc
child 3059 9143ab6cfada
Refactoring: replace asSet copy by asNewSet (same for IdentitySet) replace (xxx collect:[]) asSet by (xxx collect:[] as:Set) replace (xxx select:[]) asSet by (xxx select:[] as:Set)
Explainer.st
--- a/Explainer.st	Sat Mar 30 21:53:43 2013 +0100
+++ b/Explainer.st	Tue Apr 02 11:32:45 2013 +0200
@@ -173,8 +173,7 @@
                 (cls instanceVariableNames includes:nm) ifTrue:[
                     "/ ok - an instVar; see what values we find...
                     instances := cls allSubInstances.
-                    classesOfInstVars := instances collect:[:eachInst | (eachInst instVarNamed:nm) class].
-                    classesOfInstVars := classesOfInstVars asSet.
+                    classesOfInstVars := instances collect:[:eachInst | (eachInst instVarNamed:nm) class] as:Set.
                     canBeNil := (classesOfInstVars remove:UndefinedObject ifAbsent:[]) notNil.
                     "take care - Set cannot store nil!!"
                     implementingClasses := classesOfInstVars collect:[:cls | (cls whichClassIncludesSelector:selector) ? 0].
@@ -231,8 +230,8 @@
         implMethods size <= 5 ifTrue:[
             comments := implMethods collect:[:implMethod | implMethod comment ? ''].
             (comments includes:'') ifFalse:[
-                comments := comments collect:[:implMethodComment | implMethodComment firstLine].
-                comments asSet size == 1 ifTrue:[
+                comments := comments collect:[:implMethodComment | implMethodComment firstLine] as:Set.
+                comments size == 1 ifTrue:[
                     info := info , ' ' , (self fetchCommentOfMethod:implMethods first).
                 ].
             ].
@@ -460,8 +459,7 @@
             (cls instanceVariableNames includes:nm) ifTrue:[
                 "/ ok - an instVar; see what values we find...
                 instances := cls allSubInstances.
-                classesOfInstVars := instances collect:[:eachInst | (eachInst instVarNamed:nm) class].
-                classesOfInstVars := classesOfInstVars asSet.
+                classesOfInstVars := instances collect:[:eachInst | (eachInst instVarNamed:nm) class] as:Set.
                 ^ classesOfInstVars. 
             ].
             (cls classVariableNames includes:nm) ifTrue:[
@@ -1467,10 +1465,10 @@
 !Explainer class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Explainer.st,v 1.117 2013-03-21 10:20:13 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Explainer.st,v 1.118 2013-04-02 09:32:45 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libcomp/Explainer.st,v 1.117 2013-03-21 10:20:13 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Explainer.st,v 1.118 2013-04-02 09:32:45 stefan Exp $'
 ! !