[Pkg] The Trunk: Collections-nice.319.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Feb 25 23:07:56 UTC 2010


Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.319.mcz

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

Name: Collections-nice.319
Author: nice
Time: 26 February 2010, 12:07:50.053 am
UUID: 44063696-ed6c-804a-96ec-f8bfa5d7daf2
Ancestors: Collections-ar.318

Let ByteArray readHexFrom: read both upper and lower case

        ByteArray readHexFrom: '7A2BD507'
                => #[122 43 213 7]

=============== Diff against Collections-ar.318 ===============

Item was changed:
  ----- Method: ByteArray>>readHexFrom: (in category 'initialize') -----
  readHexFrom: aStream
  	"Initialize the receiver from a hexadecimal string representation"
  	| map v ch value |
+ 	map := '0123456789abcdefABCDEF'.
- 	map := '0123456789abcdef'.
  	1 to: self size do:[:i|
  		ch := aStream next.
  		v := (map indexOf: ch) - 1.
+ 		((v between: 0 and: 15) or: [((v:= v - 6) between: 0 and: 15)]) ifFalse:[^self error: 'Hex digit expected'].
- 		(v between: 0 and: 15) ifFalse:[^self error: 'Hex digit expected'].
  		value := v bitShift: 4.
  		ch := aStream next.
  		v := (map indexOf: ch) - 1.
+ 		((v between: 0 and: 15) or: [((v:= v - 6) between: 0 and: 15)]) ifFalse:[^self error: 'Hex digit expected'].
- 		(v between: 0 and: 15) ifFalse:[^self error: 'Hex digit expected'].
  		value := value + v.
  		self at: i put: value.
  	].
  !



More information about the Packages mailing list