From: Vincent Pit Date: Sun, 17 May 2009 15:20:21 +0000 (+0200) Subject: Don't upgrade the arguments if it's not necessary X-Git-Tag: v0.06~7 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=1f8495d3b4e12ac774a20fde0ac23297f6e2108e;p=perl%2Fmodules%2FScalar-Vec-Util.git Don't upgrade the arguments if it's not necessary --- diff --git a/Util.xs b/Util.xs index 8f6345b..f954a42 100644 --- a/Util.xs +++ b/Util.xs @@ -115,6 +115,8 @@ CODE: croak(svu_error_invarg); l = SvUV(sl); + if (!l) + XSRETURN(0); s1 = SvUV(ss1); s2 = SvUV(ss2); SvUPGRADE(sv1, SVt_PV); diff --git a/bitvect.h b/bitvect.h index a90ada9..a62f472 100644 --- a/bitvect.h +++ b/bitvect.h @@ -230,9 +230,6 @@ INLINE_DECLARE(void bv_copy(void *t_, size_t ts, const void *f_, size_t fs, size T ins, mask, *t = (T *) t_; const T *f = (const T *) f_, *end; - if (!l) - return; - t += ts / BITS(T); ts %= BITS(T); @@ -295,7 +292,7 @@ INLINE_DECLARE(void bv_move(void *bv_, size_t ts, size_t fs, size_t l)) T ins, tmp, mask, *bv = (T *) bv_, *t, *f; const T *begin, *end; - if (!l || ts == fs) + if (ts == fs) return; to = ts % BITS(T); @@ -503,9 +500,6 @@ INLINE_DECLARE(void bv_fill(void *bv_, size_t s, size_t l, unsigned int f)) size_t o, k; T mask, *bv = (T *) bv_; - if (!l) - return; - if (f) f = ~0;