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

commits at source.squeak.org commits at source.squeak.org
Sat Dec 26 00:14:52 UTC 2009


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

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

Name: Collections-nice.262
Author: nice
Time: 26 December 2009, 1:14:32 am
UUID: f49d6013-9741-4fd7-b453-7885d33f9306
Ancestors: Collections-nice.261

A return was missing in WideString>>#asPacked

Is this message used ? usable ?
I doubt you can recover String -> Packed -> String because nothing would distinguish a packed WideString from a packed ByteString...

=============== Diff against Collections-nice.261 ===============

Item was changed:
  ----- Method: String>>asPacked (in category 'converting') -----
  asPacked
  	"Convert to a longinteger that describes the string"
  
+ 	^ self inject: 0 into: [ :pack :next | pack * 256 + next asInteger ].!
- 	^ self inject: 0 into: [ :pack :next | pack := pack * 256 + next asInteger ].!

Item was changed:
  ----- Method: Collection>>groupBy:having: (in category 'enumerating') -----
  groupBy: keyBlock having: selectBlock 
  	"Like in SQL operation - Split the recievers contents into collections of 
  	elements for which keyBlock returns the same results, and return those 
  	collections allowed by selectBlock. keyBlock should return an Integer."
+ 	| result |
- 	| result key |
  	result := PluggableDictionary integerDictionary.
  	self do: 
  		[:e | 
+ 		| key |
  		key := keyBlock value: e.
  		(result includesKey: key)
  			ifFalse: [result at: key put: OrderedCollection new].
  		(result at: key)
  			add: e].
  	^ result := result select: selectBlock!

Item was changed:
  ----- Method: WideString>>asPacked (in category 'converting') -----
  asPacked
+ 	^self inject: 0 into: [:pack :next | pack * 16r100000000 + next asInteger].!
- 
- 	self inject: 0 into: [:pack :next | pack := pack * 16r100000000 + next asInteger].
- !



More information about the Packages mailing list