[squeak-dev] The Trunk: Collections-eem.757.mcz

Tobias Pape Das.Linux at gmx.de
Fri Jun 23 18:45:39 UTC 2017


Nice :)

One suggestion:
> On 23.06.2017, at 20:33, commits at source.squeak.org wrote:
> 
> + 	(array at: index) ifNil:
> + 		[self
> + 			atNewIndex: index
> + 			put: anObject asSetElement.
> + 		^true].
> + 	^false!

What about (safe for formatting) the current implementation of addNewElement: tho?

	| index |
	index := self scanFor: anObject.
	^ (array at: index)
		ifNil:
			[ self
				atNewIndex: index
				put: anObject asSetElement.
			true ]
		ifNotNil: [ false ]

Shouldn't #addNewElement: be renamed #ifAbsentAdd: and #addNewElement: a deprecated alias?

Best regards
	-Tobias

	


More information about the Squeak-dev mailing list