Skip to content

Commit 5448599

Browse files
committed
more optimlization in ToIntrinsicState>>isUnchangedOn: and isOtherSelectionsStateUnchangedOn:
1 parent c276e55 commit 5448599

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/Toplo/ToIntrinsicState.class.st

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ ToIntrinsicState >> initialize [
117117
enabledSkinEvent := ToEnabledSkinEvent new.
118118
]
119119

120+
{ #category : #'private - testing' }
121+
ToIntrinsicState >> isOtherSelectionsStateUnchangedOn: anElement [
122+
123+
| prev |
124+
prev := previousPattern at: 5.
125+
prev size = otherSelectionSkinEventMap size ifFalse: [ ^ false ].
126+
prev associationsDo: [ :each |
127+
(otherSelectionSkinEventMap at: each key ifAbsent: [ ^ false ])
128+
class = each value class ifFalse: [ ^ false ] ].
129+
^ true
130+
]
131+
120132
{ #category : #'private - testing' }
121133
ToIntrinsicState >> isUnchangedOn: anElement [
122134

@@ -125,15 +137,13 @@ ToIntrinsicState >> isUnchangedOn: anElement [
125137
(previousPattern at: 2) = (self focusStateOn: anElement) and: [
126138
(previousPattern at: 3) = self checkState and: [
127139
(previousPattern at: 4) = self selectionState and: [
128-
(previousPattern at: 5) = self otherSelectionsState ] ] ] ] ]
140+
self isOtherSelectionsStateUnchangedOn: anElement ] ] ] ] ]
129141
]
130142

131143
{ #category : #'private - accessing' }
132144
ToIntrinsicState >> otherSelectionsState [
133145

134-
^ Array new: 15 streamContents: [ :stream |
135-
otherSelectionSkinEventMap keysAndValuesDo: [ :k :v |
136-
stream nextPut: k -> v class ] ]
146+
^ otherSelectionSkinEventMap copy
137147
]
138148

139149
{ #category : #'skin dispatching' }

0 commit comments

Comments
 (0)