The Trunk: Collections-mt.778.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.778.mcz

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

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

Name: Collections-mt.778
Author: mt
Time: 14 December 2017, 11:09:04.741531 am
UUID: b85b1a4a-983f-e847-932d-fa9b6ff0a24f
Ancestors: Collections-nice.777

Fixes lazy initialization of byteArrayMap. I renamed "initialize" to "create" because I thought that (1) a special return value of an initialize method would be surprising and (2) the accessor for #byteArrayMap should remain concise.

=============== Diff against Collections-nice.777 ===============

Item was changed:
  ----- Method: CharacterSet>>byteArrayMap (in category 'accessing') -----
  byteArrayMap
  "return a ByteArray mapping each ascii value to a 1 if that ascii value is in the set, and a 0 if it isn't.  Intended for use by primitives only"
+ ^byteArrayMap ifNil: [byteArrayMap := self createByteArrayMap]!
- ^byteArrayMap ifNil: [self initializeByteArrayMap]!

Item was added:
+ ----- Method: CharacterSet>>createByteArrayMap (in category 'private') -----
+ createByteArrayMap
+ ^ (0 to: 255) asByteArray collect:
+ [:i | (self includes: (Character value: i)) ifTrue: [1] ifFalse: [0]]!

Item was removed:
- ----- Method: CharacterSet>>initializeByteArrayMap (in category 'private') -----
- initializeByteArrayMap
- byteArrayMap := (0 to: 255) asByteArray collect:
- [:i | (self includes: (Character value: i)) ifTrue: [1] ifFalse: [0]]!