[squeak-dev] The Trunk: Files-ul.67.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jan 15 19:58:25 UTC 2010


Levente Uzonyi uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-ul.67.mcz

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

Name: Files-ul.67
Author: ul
Time: 15 January 2010, 8:50:15.601 pm
UUID: 2af743dc-8903-0745-bc3f-553a2598be3f
Ancestors: Files-dtl.66

- fix StandardFileStream >> #upTo:

=============== Diff against Files-dtl.66 ===============

Item was changed:
  ----- Method: StandardFileStream>>upTo: (in category 'read, write, position') -----
  upTo: delim 
  	"Fast version to speed up nextChunk"
  	| pos buffer count |
  	collection ifNotNil: [
  		(position < readLimit and: [
+ 			(pos := collection indexOf: delim startingAt: position + 1) <= readLimit and: [
+ 				pos > 0 ] ]) ifTrue: [
+ 					^collection copyFrom: position + 1 to: (position := pos) - 1 ] ].
- 			(count := collection indexOf: delim startingAt: position + 1) <= readLimit and: [
- 				count > 0 ] ]) ifTrue: [
- 					^collection copyFrom: position + 1 to: (position := position + count) ] ].
  	pos := self position.
  	buffer := self next: 2000.
  	(count := buffer indexOf: delim) > 0 ifTrue: 
  		["Found the delimiter part way into buffer"
  		self position: pos + 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 upTo: delim)!




More information about the Squeak-dev mailing list