[squeak-dev] The Trunk: Collections-nice.342.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 19 18:17:17 UTC 2010


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

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

Name: Collections-nice.342
Author: nice
Time: 19 March 2010, 7:17:03.665 pm
UUID: 7d8aa52b-dfec-364e-bc7d-4226882bc7e0
Ancestors: Collections-ul.341

Let nextPut: answer the put object.
Same for nextPutAll:, answer the collection argument

=============== Diff against Collections-ul.341 ===============

Item was changed:
  ----- Method: WriteStream>>nextPutAll: (in category 'accessing') -----
  nextPutAll: aCollection
  
  	| newEnd |
  	collection class == aCollection class ifFalse:
  		[^ super nextPutAll: aCollection ].
  
  	newEnd := position + aCollection size.
  	newEnd > writeLimit ifTrue:
  		[self growTo: newEnd + 10].
  
  	collection replaceFrom: position+1 to: newEnd  with: aCollection startingAt: 1.
+ 	position := newEnd.
+ 	^aCollection!
- 	position := newEnd.!

Item was changed:
  ----- Method: AttributedTextStream>>nextPut: (in category 'stream protocol') -----
  nextPut: aChar
  	currentRun := currentRun + 1.
+ 	^characters nextPut: aChar!
- 	characters nextPut: aChar!

Item was changed:
  ----- Method: LimitedWriteStream>>nextPutAll: (in category 'as yet unclassified') -----
  nextPutAll: aCollection
  
  	| newEnd |
  	collection class == aCollection class ifFalse:
  		[^ super nextPutAll: aCollection ].
  
  	newEnd := position + aCollection size.
  	newEnd > limit ifTrue: [
  		super nextPutAll: (aCollection copyFrom: 1 to: (limit - position max: 0)).
+ 		limitBlock value.
+ 		^aCollection
- 		^ limitBlock value.
  	].
  	newEnd > writeLimit ifTrue: [
  		self growTo: newEnd + 10
  	].
  
  	collection replaceFrom: position+1 to: newEnd  with: aCollection startingAt: 1.
+ 	position := newEnd.
+ 	^aCollection!
- 	position := newEnd.!

Item was changed:
  ----- Method: AttributedTextStream>>nextPutAll: (in category 'stream protocol') -----
  nextPutAll: aString
  	"add an entire string with the same attributes"
  	currentRun := currentRun + aString size.
+ 	^characters nextPutAll: aString.!
- 	characters nextPutAll: aString.!

Item was changed:
  ----- Method: RWBinaryOrTextStream>>nextPut: (in category 'as yet unclassified') -----
  nextPut: charOrByte
  
+ 	^super nextPut: charOrByte asCharacter!
- 	super nextPut: charOrByte asCharacter!

Item was changed:
  ----- Method: LimitedWriteStream>>nextPut: (in category 'accessing') -----
  nextPut: anObject 
  	"Ensure that the limit is not exceeded"
  
+ 	position >= limit
+ 		ifTrue:
+ 			[ limitBlock value.
+ 			^anObject ].
+     ^super nextPut: anObject
-  position >= limit ifTrue: [limitBlock value]
-     ifFalse: [super nextPut: anObject].
  !

Item was changed:
  ----- Method: SharedQueue2>>nextPut: (in category 'accessing') -----
  nextPut: item
  	monitor critical: [
  		items addLast: item.
+ 		monitor signalAll.  ].
+ 	^item!
- 		monitor signalAll.  ]
- !

Item was changed:
  ----- Method: TextStream>>nextPutAll: (in category 'as yet unclassified') -----
  nextPutAll: aCollection 
  	"Optimized access to get around Text at:Put: overhead"
  	| n |
  	n := aCollection size.
+ 	position + n > writeLimit
+ 		ifTrue:
+ 			[self growTo: position + n + 10].
-      position + n > writeLimit
-        ifTrue:
-         [self growTo: position + n + 10].
  	collection 
  		replaceFrom: position+1
  		to: position + n
  		with: aCollection
  		startingAt: 1.
+ 	position := position + n.
+ 	^aCollection!
- 	position := position + n!




More information about the Squeak-dev mailing list