Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.642.mcz==================== Summary ====================
Name: Collections-ul.642
Author: ul
Time: 17 August 2015, 10:12:38.668 pm
UUID: 4a6c1591-8a42-41a2-b3ae-2644c2d12320
Ancestors: Collections-ul.641
- Character >> #shouldBePrintedAsLiteral uses the local variable holding the integer value of the character. Also added quick returns.
WideCharacterSet
- faster #includes:
- use #integerDictionary for map
=============== Diff against Collections-ul.641 ===============
Item was changed:
----- Method: Character>>shouldBePrintedAsLiteral (in category 'testing') -----
shouldBePrintedAsLiteral
| integerValue |
+ (integerValue := self asInteger) < 33 ifTrue: [ ^false ].
+ 255 < integerValue ifTrue: [ ^false ].
+ ^integerValue ~= 127!
- ^((integerValue := self asInteger) between: 33 and: 255) and: [self asInteger ~= 127]!
Item was changed:
----- Method: WideCharacterSet>>includes: (in category 'collection ops') -----
includes: aCharacter
+
+ | value bitmap |
+ (value := aCharacter asInteger) < 256 ifTrue: [
+ ^(byteArrayMap at: value + 1) ~= 0 ].
+ bitmap := (map at: (value bitShift: -16) ifAbsent: nil) ifNil: [ ^false ].
+ ^(self
+ bitmap: bitmap
+ at: (value bitAnd: 16rFFFF)) ~= 0!
- | val high low |
- val := aCharacter asciiValue.
- high := val bitShift: -16.
- low := val bitAnd: 16rFFFF.
- ^(self
- bitmap: (map
- at: high
- ifAbsent: [^ false])
- at: low) isZero not!
Item was changed:
----- Method: WideCharacterSet>>initialize (in category 'initialize-release') -----
initialize
+
+ map := PluggableDictionary integerDictionary.
- map := Dictionary new.
byteArrayMap := ByteArray new: 256!