The Trunk: Morphic-mt.1126.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-mt.1126.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1126.mcz

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

Name: Morphic-mt.1126
Author: mt
Time: 1 May 2016, 11:28:52.934127 am
UUID: 6d6940ad-4542-d94f-9b90-8df2649f381d
Ancestors: Morphic-mt.1125

Refactors the code for the columns cache in tree morphs.

=============== Diff against Morphic-mt.1125 ===============

Item was changed:
  ----- Method: IndentingListItemMorph>>widthOfColumn: (in category 'accessing - columns') -----
  widthOfColumn: columnIndex
+
+ ^ (container widthOfColumn: columnIndex) ifNil: [self width]!
- | widthOrSpec |
- container columns ifNil: [ ^ self width ].
- (container columnsCache at: columnIndex)
- ifNotNil: [ :cachedWidth | ^ cachedWidth ].
- widthOrSpec := container columns at: columnIndex.
- ^ container columnsCache at: columnIndex put: (widthOrSpec isNumber
- ifTrue: [ widthOrSpec ]
- ifFalse:
- [ widthOrSpec isBlock
- ifTrue:
- [ widthOrSpec
- cull: container
- cull: self ]
- ifFalse:
- [ widthOrSpec
- ifNil: [ self width ]
- ifNotNil: [ "Fall back"
- 50 ] ] ])!

Item was added:
+ ----- Method: SimpleHierarchicalListMorph>>widthOfColumn: (in category 'private - caching') -----
+ widthOfColumn: index
+
+ self columns ifNil: [^ nil].
+
+ "Try columns cache."
+ (self columnsCache at: index)
+ ifNotNil: [:cachedWidth | ^ cachedWidth].
+
+ ^ (self columns at: index)
+ ifNil: [nil]
+ ifNotNil: [:widthOrSpec |
+ "Fill columns cache."
+ self columnsCache
+ at: index
+ put: (widthOrSpec isNumber
+ ifTrue: [widthOrSpec]
+ ifFalse: [widthOrSpec isBlock
+ ifTrue: [widthOrSpec cull: self]
+ ifFalse: [50 "fall back for bad spec"]])]!