'From Squeak3.2alpha of 2 October 2001 [latest update: #4516] on 14 November 2001 at 10:07:58 pm'! "Change Set: FasterKnownNames Date: 14 November 2001 Author: Dan Ingalls This changeSet includes: A change to how Morph>>allKnownNames is computed. The old method allocated and copied arrays at every level. The new one simply evaluates a block, and that only when a knownName is found. This change provides a speedup of roughly 4x. Moreover the new logic, as a result, can exit early when the mechanism is being used to search for a match. In addition, PluggableListMorph overrides this method with a no-op, thus effecting another 3x of speedup in projects with a number of browsers. Finally, the redundant deprecated method UndefinedObject>>doIfNotNil: has been removed (it is also covered also in Object). "! !Morph methodsFor: 'submorphs-accessing' stamp: 'di 11/14/2001 12:50'! allKnownNames "Return a list of all known names based on the scope of the receiver. Does not include the name of the receiver itself. Items in parts bins are excluded. Reimplementors (q.v.) can extend the list" ^ Array streamContents: [:s | self allSubmorphNamesDo: [:n | s nextPut: n]] ! ! !Morph methodsFor: 'submorphs-accessing' stamp: 'di 11/14/2001 12:44'! allSubmorphNamesDo: nameBlock "Return a list of all known names of submorphs and nested submorphs of the receiver, based on the scope of the receiver. Items in parts bins are excluded" self isPartsBin ifTrue: [^ self]. "Don't report names from parts bins" self submorphsDo: [:m | m knownName ifNotNilDo: [:n | nameBlock value: n]. m allSubmorphNamesDo: nameBlock]. ! ! !PluggableListMorph methodsFor: 'model access' stamp: 'di 11/14/2001 13:57'! allSubmorphNamesDo: nameBlock "Assume list morphs do not have named parts -- saves MUCH time" ^ self! ! UndefinedObject removeSelector: #doIfNotNil:! Morph removeSelector: #knownNamesOfSubmorphs!