[squeak-dev] The Trunk: Tools-jr.930.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Mar 5 12:28:54 UTC 2020


Nicolas Cellier uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-jr.930.mcz

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

Name: Tools-jr.930
Author: jr
Time: 8 February 2020, 10:41:43.910741 am
UUID: c64775b8-3ea3-9d41-81a3-8eea293ee438
Ancestors: Tools-jr.929, Tools-mt.929

Speed up removing of messages from MessageTrace.

In an existing MessageTrace, try "senders of at:put:", then remove them again with "remove from this browser (d)". Took several seconds before, finishes in an instant now.

Replaces autoSelectStrings and messageSelections with new OrderedCollections. The other method deleteFromMessageList: removes one element from the existing collections instead.

=============== Diff against Tools-jr.929 ===============

Item was added:
+ ----- Method: MessageSet>>deleteAllFromMessageList: (in category 'message functions') -----
+ deleteAllFromMessageList: aCollection
+ 	"Delete the given messages from the receiver's message list"
+ 	| currIdx |
+ 	currIdx := self messageListIndex.
+ 	messageList := messageList copyWithoutAll: aCollection.
+ 	messageList ifNotEmpty: [self messageListIndex: {currIdx. messageList size.} min]!

Item was added:
+ ----- Method: MessageTrace>>deleteAllFromMessageList: (in category 'building') -----
+ deleteAllFromMessageList: aCollection
+ 	"Delete the given messages from the receiver's message list"
+ 
+ 	| newAutoSelectStrings newMessageSelections newSize set |
+ 	newSize := self messageList size - aCollection size.
+ 	newAutoSelectStrings := OrderedCollection new: newSize.
+ 	newMessageSelections := OrderedCollection new: newSize.
+ 	set := aCollection asSet.
+ 	self messageList withIndexDo: [:each :index |
+ 		(set includes: each) ifFalse:
+ 			[newAutoSelectStrings add: (autoSelectStrings at: index).
+ 			newMessageSelections add: (messageSelections at: index)]].
+ 	super deleteAllFromMessageList: aCollection.
+ 	autoSelectStrings := newAutoSelectStrings.
+ 	messageSelections := newMessageSelections.
+ 	anchorIndex ifNotNil:
+ 		[ anchorIndex := anchorIndex min: messageList size ]!

Item was changed:
  ----- Method: MessageTrace>>removeMessageFromBrowser (in category 'building') -----
  removeMessageFromBrowser
  	| indexToSelect |
  	"Try to keep the same selection index."
  	indexToSelect := (messageSelections indexOf: true) max: 1.
+ 	self deleteAllFromMessageList: self selectedMessages.
- 	self selectedMessages do: [ :eachMethodReference | self deleteFromMessageList: eachMethodReference ].
  	self deselectAll.
  	messageSelections ifNotEmpty:
  		[ messageSelections 
  			at: (indexToSelect min: messageSelections size)  "safety"
  			put: true ].
  	anchorIndex := indexToSelect min: messageSelections size.
  	self 
  		messageListIndex: anchorIndex ; 
  		reformulateList!



More information about the Squeak-dev mailing list