in reply to Re: optimization - exists should return a reference
in thread optimization - exists should return a reference
The real solution would be common subexpression optimization, which is significantly more difficult.Even more than most people think. Not only is it a bit of a pain to do, and somwehat time consuming, but it potentially alters the semantics of the program. If a hash is tied, caching the return from exists, if exists returns a ref, changes a two-tie-hit to a one-tie-hit. While this may not necessarily be a bad thing, it is definitely a change in behaviour.
|
|---|