The Trunk: Collections-mt.842.mcz

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

The Trunk: Collections-mt.842.mcz

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

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

Name: Collections-mt.842
Author: mt
Time: 12 July 2019, 9:59:20.039568 am
UUID: 3515a0c8-a91a-5b47-a466-71ea1e2d5b85
Ancestors: Collections-mt.841

Refactoring of #literalsDo: - Step 2 of 3.

For more information, see http://forum.world.st/Please-Review-Refactoring-for-literalsDo-etc-tp5099756p5100896.html.

=============== Diff against Collections-mt.841 ===============

Item was removed:
- ----- Method: Array>>hasLiteral: (in category 'private') -----
- hasLiteral: literal
- "Answer true if literal is identical to any literal in this array, even
- if imbedded in further array structure. This method is only intended
- for private use by CompiledMethod hasLiteralSymbol:"
-
- | lit |
- 1 to: self size do:
- [:index |
- ((lit := self at: index) literalEqual: literal) ifTrue: [^true].
- (Array == lit class and: [lit hasLiteral: literal]) ifTrue: [^true]].
- ^false!

Item was removed:
- ----- Method: Array>>hasLiteralSuchThat: (in category 'private') -----
- hasLiteralSuchThat: testBlock
- "Answer true if testBlock returns true for any literal in this array, even if imbedded in further Arrays or CompiledMethods.  This method is only intended for private use by CompiledMethod hasLiteralSuchThat:"
- | lit |
- 1 to: self size do: [:index |
- (testBlock value: (lit := self at: index)) ifTrue: [^ true].
- (lit hasLiteralSuchThat: testBlock) ifTrue: [^ true]].
- ^ false!

Item was changed:
+ ----- Method: Array>>literalEqual: (in category 'literals') -----
- ----- Method: Array>>literalEqual: (in category 'comparing') -----
  literalEqual: other
 
  self class == other class ifFalse: [^ false].
  self size = other size ifFalse: [^ false].
  self with: other do: [:e1 :e2 |
  (e1 literalEqual: e2) ifFalse: [^ false]].
  ^ true!