<div dir="ltr">Here we see some of my thinking at the time when I was working very hard to save cycles in places that are iterative. The simple check for a scalar, instead of the 6 times more expensive hash member, was done before taking the time to instantiate the hash. I believe that some of these things, mostly resisting objects in code likely to be called hundreds of times per page, kept Interchange fast enough to be competitive.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 11, 2016 at 3:15 PM, Jon Jensen <span dir="ltr"><<a href="mailto:jon@endpoint.com" target="_blank">jon@endpoint.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 11 Nov 2016, David Christensen wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 08/11/16 08:32, David Christensen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   Fix code which assumes we already have a hashref<br>
+       $item = { 'code' => $item } unless ref $item;<br>
+<br>
        return $item->{mv_cache_price}<br>
                if ! $quantity and ref($item) and defined $item->{mv_cache_price};<br>
<br>
-       $item = { 'code' => $item } unless ref $item;<br>
</blockquote>
<br>
This does not look like it was broken before, it certainly did not<br>
assume that we had a hashref as it specifically tested for it in the if<br>
statement.<br>
</blockquote>
<br>
True, I think I missed it ref() in that condition; had some across an error in an installation related to dereferencing a string and thought I’d found the solution.  I could revert or just leave it, as it doesn’t have any practical difference; otherwise it’s just VCS noise at this point.<br>
</blockquote>
<br>
If you want to leave it the new way, I think we should remove this now redundant check:<br>
<br>
    and ref($item)<br>
<br>
so that at least the net result of the version control churn is one less check of ref($item) in that same area. :)<span class="HOEnZb"><font color="#888888"><br>
<br>
Jon<br>
<br>
<br>
-- <br>
Jon Jensen<br>
End Point Corporation<br>
<a href="https://www.endpoint.com/" rel="noreferrer" target="_blank">https://www.endpoint.com/</a></font></span><br>______________________________<wbr>_________________<br>
interchange-users mailing list<br>
<a href="mailto:interchange-users@icdevgroup.org">interchange-users@icdevgroup.<wbr>org</a><br>
<a href="http://www.icdevgroup.org/mailman/listinfo/interchange-users" rel="noreferrer" target="_blank">http://www.icdevgroup.org/<wbr>mailman/listinfo/interchange-<wbr>users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">The problem with Internet quotations is that many of them<br>are not genuine. -- Abraham Lincoln<br></div>
</div>