[squeak-dev] The Trunk: Files-nice.52.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Dec 8 18:05:43 UTC 2009


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

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

Name: Files-nice.52
Author: nice
Time: 8 December 2009, 7:05:36 am
UUID: bc850e55-223e-4cc3-a88c-d0282f4b70c7
Ancestors: Files-ul.51

Correct my own bug in upToAnyOf:do: (nextLine)

=============== Diff against Files-ul.51 ===============

Item was changed:
  ----- Method: StandardFileStream>>upToAnyOf:do: (in category 'read, write, position') -----
  upToAnyOf: delimiters do: aBlock
  	"Fast version to speed up nextChunk"
  	| pos buffer count result |
  	collection ifNotNil: [
  		(position < readLimit and: [
  			(count := collection indexOfAnyOf: delimiters startingAt: position + 1) <= readLimit and: [
  				count > 0 ] ]) ifTrue: [
+ 					result := collection copyFrom: position + 1 to: (position := count) - 1.
- 					result := collection copyFrom: position + 1 to: (position := position + count).
  					aBlock value: (collection at: count).
  					^result ] ].
  	pos := self position.
  	buffer := self next: 2000.
  	(count := buffer indexOfAnyOf: delimiters) > 0 ifTrue: 
  		["Found one of the delimiters part way into buffer"
  		self position: pos + count.
  		aBlock value: (buffer at: count).
  		^ buffer copyFrom: 1 to: count - 1].
  	self atEnd ifTrue:
  		["Never found it, and hit end of file"
  		^ buffer].
  	"Never found it, but there's more..."
  	^ buffer , (self upToAnyOf: delimiters do: aBlock)!




More information about the Squeak-dev mailing list