[squeak-dev] The Trunk: Collections-ar.123.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Sep 1 07:38:36 UTC 2009


Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ar.123.mcz

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

Name: Collections-ar.123
Author: ar
Time: 1 September 2009, 12:38:06 pm
UUID: e7432274-e18a-1e43-a002-f3ab261bd465
Ancestors: Collections-tfel.122

Some fixes for RWBinaryOrTextStream which was too agressive optimizing some paths. Also fixes Character>>codePoint: which has no reason to raise an exception for values > 256.

=============== Diff against Collections-tfel.122 ===============

Item was added:
+ ----- Method: RWBinaryOrTextStream>>upTo: (in category 'accessing') -----
+ upTo: anObject 
+ 	"Answer a subcollection from the current access position to the 
+ 	occurrence (if any, but not inclusive) of anObject in the receiver. If 
+ 	anObject is not in the collection, answer the entire rest of the receiver."
+ 	| newStream element species |
+ 	species := isBinary ifTrue:[ByteArray] ifFalse:[String].
+ 	newStream := WriteStream on: (species new: 100).
+ 	[self atEnd or: [(element := self next) = anObject]]
+ 		whileFalse: [newStream nextPut: element].
+ 	^newStream contents!

Item was changed:
  ----- Method: RWBinaryOrTextStream>>next:putAll:startingAt: (in category 'writing') -----
  next: anInteger putAll: aCollection startingAt: startIndex
+ 	"Optimized for ByteArrays"
+ 	aCollection class == ByteArray 
+ 		ifTrue:[^super next: anInteger putAll: aCollection asString startingAt: startIndex].
+ 	^super next: anInteger putAll: aCollection startingAt: startIndex!
- 	^super next: anInteger putAll: aCollection asString startingAt: startIndex!

Item was changed:
  ----- Method: RWBinaryOrTextStream>>nextPutAll: (in category 'writing') -----
  nextPutAll: aCollection
+ 	"Optimized for ByteArrays"
+ 	aCollection class == ByteArray 
+ 		ifTrue:[^super nextPutAll: aCollection asString].
+ 	^super nextPutAll: aCollection!
- 	^super nextPutAll: aCollection asString!

Item was changed:
  ----- Method: Character class>>codePoint: (in category 'instance creation') -----
  codePoint: integer 
+ 	"Return a character whose encoding value is integer.
+ 	For ansi compability."
+ 	^self value: integer!
- 	"Return a character whose encoding value is integer."
- 	#Fundmntl.
- 	(0 > integer or: [255 < integer])
- 		ifTrue: [self error: 'parameter out of range 0..255'].
- 	^ CharacterTable at: integer + 1!




More information about the Squeak-dev mailing list