From: Lukas Mai Date: Fri, 8 Mar 2013 02:58:32 +0000 (+0100) Subject: cache ERRSV in a local variable X-Git-Tag: v1.0102~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c90fb97af3831f27bbaa7aa99895902d1fc64838;hp=82bcf8b5f451acf6489b20680a268b6a95b63252;p=p5sagit%2FFunction-Parameters.git cache ERRSV in a local variable Turns out 'SvTRUE(ERRSV)' expands to truly hideous code. 'SV *err = ERRSV; if (SvTRUE(err))' looks slightly better. --- diff --git a/Parameters.xs b/Parameters.xs index ec46ef3..282bb03 100644 --- a/Parameters.xs +++ b/Parameters.xs @@ -774,9 +774,11 @@ static size_t count_named_params(const ParamSpec *ps) { } static void my_require(pTHX_ const char *file) { + SV *err; require_pv(file); - if (SvTRUE(ERRSV)) { - croak_sv(ERRSV); + err = ERRSV; + if (SvTRUE(err)) { + croak_sv(err); } }