Re: [Module::Build] add_build_element Should Add Only Once
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <ml...@th...> - 2006-02-25 03:58:19
|
David E.Wheeler wrote: > Module::Builders, > > Somehow, I've been finding in my tests that the same element keeps > getting added to my build objets over and over again. I don't know why, > but the fix is easy. > > The attached patch modifies add_build_element() so that it only adds the > element if it doesn't already exist. Any reason *not* to do this? I had a look. I don't see anywhere this might be happening within M::B. The build_elements property is touched very few times, almost exclusively for read-only access. The only place where it's modified is in the add_build_elements method and it is never called within M::B. If it is something in M::B causing the duplication, I'd like to find it, but I don't think it is from my quick look. Maybe something on your side? Anyhow, your patch seems like a good idea as a preventative, so I've applied it. Thanks, Randy. |