[Pkg] The Trunk: System-ul.418.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Feb 7 19:52:20 UTC 2011


Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.418.mcz

==================== Summary ====================

Name: System-ul.418
Author: ul
Time: 7 February 2011, 8:51:38.4 pm
UUID: 60f051e7-f128-6742-97c5-eb010657b574
Ancestors: System-laza.417

Faster SmalltalkImage >> #cleanUpUndoCommands (~22x) resulting in ~5x faster SmalltalkImage >> #cleanUp.

=============== Diff against System-laza.417 ===============

Item was changed:
  ----- Method: SmalltalkImage>>cleanUpUndoCommands (in category 'shrinking') -----
  cleanUpUndoCommands
  	"Smalltalk cleanUpUndoCommands"  "<== print this to get classes involved"
  
+ 	| classes keysToBeRemoved |
- 	| classes |
  	classes := Bag new.
+ 	keysToBeRemoved := OrderedCollection new.
+ 	SystemNavigation default allObjectsDo: [ :object |
+ 		object isMorph ifTrue: [
+ 			object otherProperties ifNotNil: [ :properties |
+ 				properties keysAndValuesDo: [ :key :value |
+ 					value class == Command ifTrue: [
+ 						keysToBeRemoved add: key ] ].
+ 				keysToBeRemoved ifNotEmpty: [
+ 					classes add: object className withOccurrences: keysToBeRemoved size.
+ 					keysToBeRemoved do: [ :each |
+ 						object removeProperty: each ].
+ 					keysToBeRemoved reset ] ] ] ].
+ 	^classes!
- 	'Ferreting out obsolete undo commands'
- 		displayProgressAt: Sensor cursorPoint
- 		from: 0 to: Morph withAllSubclasses size
- 		during:
- 	[:bar | | i | i := 0.
- 	Morph withAllSubclassesDo:
- 		[:c | bar value: (i := i+1).
- 		c allInstancesDo:
- 			[:m | | p | (p := m otherProperties) ifNotNil:
- 				[p keys do:
- 					[:k | (p at: k) class == Command ifTrue:
- 						[classes add: c name.
- 						m removeProperty: k]]]]]].
- 	^ classes!



More information about the Packages mailing list