roxen.lists.pike.general

Subject Author Date
Re: Iterators and deleting entries from mappings Stephen R. van den Berg <srb[at]cuci[dot]nl> 15-01-2009
Martin Stjernholm wrote:
>"Mirar @ Pike  importm??te f??r mailinglistan" <<6341[at]lyskom.lysator.liu.se>>
skrev:
>> I had expected the mapping to get a copy-on-write flag and to loop
>> over all the initial values. :p

>The thing is that your wanted behavior is very easy to achieve by
>doing the deferred copy explicitly:

>   foreach (m + ([]); mixed ind; mixed val) {
>     ..

>It's both simple and makes the code more obvious. But in cases where
>an implicit deferred copy is unwanted overhead, it cannot be avoided
>with the current mapping behavior.

Well, it's not performance critical where I need it now, so it's fine,
it just is more than I'd expected.
-- 
Sincerely,
           Stephen R. van den Berg.
The ultimate Darwin Award winner:
Going first in a Russian roulette game with a normal gun (no revolver).