[FIX] stringChanged-ls

Ned Konz ned at bike-nomad.com
Wed Oct 17 00:49:09 UTC 2001


On Tuesday 16 October 2001 05:52 pm, Lex Spoon wrote:
> "Change Set:		stringChanged-ls
> Date:			16 October 2001
> Author:			Lex Spoon
>
> A call to [self changed] got accidentally deleted, somehow.  This puts
> it back in."!

No, it got deliberately deleted by me back some time ago when I realized that 
most of the time changed was being called multiple times. But I missed the 
one case where when the bounds were the same it got short-circuited and 
changed wasn't called.

I posted a fix Friday (StringChangedFix-nk) that takes care of the case where 
the new string is exactly the same size as the old one, which was the only 
situation where it didn't call changed.

Look at the existing logic:

StringMorph>>fitContents calls
Morph>>extent: which calls
Morph>>changed (unless the bounds are the same, which is what my most recent 
change fixed).

The change you posted will call changed twice most of the time, except in the 
case where the bounds are the same.

Better to call it exactly once.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list