much faster update (only invalidate once, when multiple methods are compiled)
authorClaus Gittinger <cg@exept.de>
Wed, 09 Aug 2006 13:56:05 +0200
changeset 6855 93bacd7fcf14
parent 6854 7934fb88c60b
child 6856 da73d89f6f09
much faster update (only invalidate once, when multiple methods are compiled)
Tools_MethodCategoryList.st
--- a/Tools_MethodCategoryList.st	Tue Aug 08 20:27:04 2006 +0200
+++ b/Tools_MethodCategoryList.st	Wed Aug 09 13:56:05 2006 +0200
@@ -621,37 +621,61 @@
 !
 
 update:something with:aParameter from:changedObject
+    |cls sel oldMethod newMethod|
 
     "/ some can be ignored immediately
     changedObject == Smalltalk ifTrue:[
-	something isNil ifTrue:[
-	    "/ self halt "/ huh - Smalltalk changed - so what ?
-	    ^ self.
-	].
+        something isNil ifTrue:[
+            "/ self halt "/ huh - Smalltalk changed - so what ?
+            ^ self.
+        ].
+        something == #methodInClass ifTrue:[
+            "/ a method has been added/removed/changed
+            cls := aParameter at:1.
+            (classes notNil and:[classes includesIdentical:cls]) ifFalse:[^ self].
+            sel := aParameter at:2.
+            oldMethod := aParameter at:3.
+            newMethod := cls compiledMethodAt:sel.
+            oldMethod notNil ifTrue:[
+                variableFilter value size > 0 ifTrue:[
+                    "/ sigh - must invalidate
+                    self invalidateList.
+                    ^ self.    
+                ].
+                oldMethod category ~= newMethod category ifTrue:[
+                    self invalidateList.
+                    ^ self.    
+                ].
+                "/ mhmh - its now changed (so coloring will change).
+                self invalidateList.
+                ^ self.
+            ].
+        ].
+
 "/        something == #classDefinition ifTrue:[
 "/            ^ self.
 "/        ].
-	something == #newClass ifTrue:[
-	    ^ self.
-	].
-	something == #classRemove ifTrue:[
-	    ^ self.
-	].
-	something == #classRename ifTrue:[
-	    ^ self.
-	].
+        something == #newClass ifTrue:[
+            ^ self.
+        ].
+        something == #classRemove ifTrue:[
+            ^ self.
+        ].
+        something == #classRename ifTrue:[
+            ^ self.
+        ].
 "/        something == #classVariables ifTrue:[
 "/            ^ self.
 "/        ].
-	something == #classComment ifTrue:[
-	    ^ self.
-	].
-	something == #organization ifTrue:[
-	    ^ self.
-	].
-	something == #methodTrap ifTrue:[
-	    ^ self
-	].
+        something == #classComment ifTrue:[
+            ^ self.
+        ].
+        something == #organization ifTrue:[
+            ^ self.
+        ].
+        something == #methodTrap ifTrue:[
+            ^ self
+        ].
     ].
 
     super update:something with:aParameter from:changedObject.
@@ -1240,5 +1264,5 @@
 !MethodCategoryList class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.14 2006-03-16 14:51:13 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools_MethodCategoryList.st,v 1.15 2006-08-09 11:56:05 cg Exp $'
 ! !