[FIX] SequenceableCollection>>forceTo:paddingWith:
Doug Way
dway at riskmetrics.com
Tue Oct 31 23:44:32 UTC 2000
Andres Valloud wrote:
>
> > Fixes a bug in SequenceableCollection>>forceTo:paddingWith: introduced
> > in update #2018. Executing ''asdf' forceTo: 3 paddingWith: $-' was
> > causing an error, instead of being truncated. This new version still
> > includes the optimizations from #2018, but with an extra check to handle
> > this case.
>
> Hmmmm... I think it would be better to remove the comment in
> from:to:put: regarding the bound check, and then insert a line at the
> beginning of the method with something like:
>
> startIndex > endIndex ifTrue: [^self].
Yes, you're right. Somehow it didn't occur to me that the current forceTo:paddingWith: was very close to working as is.
- Doug Way
dway at riskmetrics.com
More information about the Squeak-dev
mailing list
|