#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Wed, 07 Feb 2018 12:08:22 +0100
changeset 8286 826c287de344
parent 8285 fcec3749083e
child 8287 d6e2901d99f9
#REFACTORING by stefan class: SimpleView changed: #addDependent: #dependents:
SimpleView.st
--- a/SimpleView.st	Mon Feb 05 00:40:05 2018 +0100
+++ b/SimpleView.st	Wed Feb 07 12:08:22 2018 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -5052,39 +5050,40 @@
 
     wasBlocked := OperatingSystem blockInterrupts.
     [
-	|deps|
-
-	deps := dependents.
-	"/
-	"/ store the very first dependent directly in
-	"/ the dependents instVar
-	"/
-	(deps isNil and:[anObject isCollection not]) ifTrue:[
-	    dependents := anObject
-	] ifFalse:[
-	    "/
-	    "/ store more dependents in the dependents collection
-	    "/
-	    deps isCollection ifTrue:[
-		deps add:anObject
-	    ] ifFalse:[
-		deps == anObject ifFalse:[
-		    deps isNil ifTrue:[
-			dependents := (IdentitySet with:anObject)
-		    ] ifFalse:[
-			dependents := (IdentitySet with:deps with:anObject)
-		    ]
-		]
-	    ]
-	]
+        |deps|
+
+        deps := dependents.
+        "/
+        "/ store the very first dependent directly in
+        "/ the dependents instVar
+        "/
+        (deps isNil and:[anObject isCollection not]) ifTrue:[
+            dependents := anObject
+        ] ifFalse:[
+            "/
+            "/ store more dependents in the dependents collection
+            "/
+            deps isCollection ifTrue:[
+                deps add:anObject
+            ] ifFalse:[
+                deps ~~ anObject ifTrue:[
+                    deps isNil ifTrue:[
+                        dependents := IdentitySet with:anObject.
+                    ] ifFalse:[
+                        dependents := IdentitySet with:deps with:anObject.
+                    ]
+                ]
+            ]
+        ]
     ] ensure:[
-	wasBlocked ifFalse:[
-	    OperatingSystem unblockInterrupts
-	]
+        wasBlocked ifFalse:[
+            OperatingSystem unblockInterrupts
+        ]
     ]
 
-    "Modified: 8.1.1997 / 23:40:30 / cg"
-    "Created: 11.6.1997 / 13:10:40 / cg"
+    "Modified: / 08-01-1997 / 23:40:30 / cg"
+    "Created: / 11-06-1997 / 13:10:40 / cg"
+    "Modified: / 07-02-2018 / 11:56:42 / stefan"
 !
 
 breakDependents
@@ -5109,23 +5108,24 @@
     "Modified: / 26.1.1998 / 11:18:36 / cg"
 !
 
-dependents:aCollection
+dependents:aCollectionOrNil
     "set the collection of dependents.
      Views keep them in an instance variable to avoid overhead."
 
     |dep|
 
-    aCollection size == 1 ifTrue:[
-	dep := aCollection first.
-	dep isCollection ifFalse:[
-	    dependents := aCollection first.
-	    ^ self
-	]
-    ].
-    dependents := aCollection
-
-    "Modified: 19.4.1996 / 12:23:05 / cg"
-    "Created: 11.6.1997 / 13:10:47 / cg"
+    aCollectionOrNil size == 1 ifTrue:[
+        dep := aCollectionOrNil first.
+        dep isCollection ifFalse:[
+            dependents := dep.
+            ^ self
+        ]
+    ].
+    dependents := aCollectionOrNil
+
+    "Modified: / 19-04-1996 / 12:23:05 / cg"
+    "Created: / 11-06-1997 / 13:10:47 / cg"
+    "Modified: / 07-02-2018 / 11:52:01 / stefan"
 !
 
 dependentsDo:aBlock