Joe Schaefer wrote:
Stas Bekman <[EMAIL PROTECTED]> writes:


I'm reviewing parts of the API and I have second thoughts about this
return-the-prev-value-on-set feature. While it's nice and perlish, it's not
always efficient. If the user doesn't care what was the previous value
and just wants to set a new value, we shouldn't enforce on her the
overhead of making another call to get the previous vallue.


Then I suggest you test for GIMME==G_VOID and drop the return
value in a void context.  That way no existing code is affected
and the (presumably) common case is optimized.

The idea is good, but not applicable in our API, since we return undef if the operation has failed, there is never a void context. (unless you choose not to check the return status).


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to