I think for the 0 case we should think about instantiating the SubscriptionRegistry lazily. This would also mitigate the effect that if a lot of announcers are created they create only a single object instead of two until used. Of course this depends on the probability of having a lot of announcers where only a few are used.
The #announce: method looks like it has been lazy before.
Announcer>>#announce: anAnnouncement
�� �� �� �� | announcement |
�� �� �� �� announcement := anAnnouncement asAnnouncement.
�� �� �� �� registry ifNotNil: [
�� �� �� �� �� �� �� �� registry deliver: announcement
�� �� �� �� �� �� �� �� ].
�� �� �� �� ^ announcement
checks for #ifNotNil: but registry is created in #initialize. So #ifNotEmpty: would be right here but #deliver: checks that, too.