[squeak-dev] The Trunk: Collections-EG.908.mcz

commits at source.squeak.org commits at source.squeak.org
Wed May 4 08:41:11 UTC 2022


Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-EG.908.mcz

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

Name: Collections-EG.908
Author: EG
Time: 7 August 2020, 8:17:30.343164 pm
UUID: d02855a8-a339-4f1d-bede-89a50f07892e
Ancestors: Collections-eem.907

Changing  behavior of #peekBack to (correctly) return first element of underlying collection when stream position is 1.

=============== Diff against Collections-eem.907 ===============

Item was changed:
  ----- Method: PositionableStream>>peekBack (in category 'accessing') -----
  peekBack
  	"Return the element at the previous position, without changing position.  Use indirect messages in case self is a StandardFileStream."
- 
  	| element |
  	self position = 0 ifTrue: [self errorCantGoBack].
+ 	element := self back.
- 	self position = 1 ifTrue: [self position: 0.  ^ nil].
- 	self skip: -2.
- 	element := self next.
  	self skip: 1.
  	^ element!



More information about the Squeak-dev mailing list