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

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Feb 8 17:29:12 UTC 2020


+1 :-)


Some really minor critic that probably no one else cares:


> +        | currIdx |

I don't think Smalltalk code needs such counterintuitive abbreviations.

> {currIdx. messageList size.} min

could be written as: (currIdx min: messageList size).

But it's rather a question of taste, it's nice to have some people caring about our wonderful Squeak tools :-)

Best,
Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Samstag, 8. Februar 2020 10:41:33
An: squeak-dev at lists.squeakfoundation.org
Betreff: [squeak-dev] The Inbox: Tools-jr.930.mcz

A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/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!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200208/c5ea659d/attachment.html>


More information about the Squeak-dev mailing list