(waste of memory? one array? ... who cares?)
what if one of the members of @observer_peers' update method removes everything from @observer_peers? How will the rest of the members get their update? What if they needed to do stuff to properly clean up too?
···
On May 23, 2008, at 11:49 , S2 wrote:
for i in @observer_peers.dup
i.update(*arg)
end
Why is there a "dup" on the array? Is that really necessary? Isn't this a
waste of memory? I am sure there is a really good explanation, but I don't
grasp it.
How would an observer peer have the ability to change the list (other than removing itself, of course)? it seems to me that the list owner would not allow that kind of access. On the other hand, perhaps removing itself from the list might also hose the iteration.
///ark
···
On May 23, 2008, at 12:57 PM, Ryan Davis wrote:
what if one of the members of @observer_peers' update method removes everything from @observer_peers? How will the rest of the members get their update? What if they needed to do stuff to properly clean up too?