From: Nicholas Clark Date: Wed, 16 Apr 2008 10:59:28 +0000 (+0000) Subject: Using memEQ() rather than strnEQ() when the length is known feels X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7edbdc6bb49f5970d9a4f23864d7626f8390de5c;p=p5sagit%2Fp5-mst-13.2.git Using memEQ() rather than strnEQ() when the length is known feels cleaner. p4raw-id: //depot/perl@33696 --- diff --git a/gv.c b/gv.c index 23a694c..6bcf2bb 100644 --- a/gv.c +++ b/gv.c @@ -520,7 +520,7 @@ Perl_gv_fetchmeth_autoload(pTHX_ HV *stash, const char *name, STRLEN len, I32 le if (!stash) return NULL; /* UNIVERSAL::AUTOLOAD could cause trouble */ - if (len == S_autolen && strnEQ(name, S_autoload, S_autolen)) + if (len == S_autolen && memEQ(name, S_autoload, S_autolen)) return NULL; if (!(gv = gv_fetchmeth(stash, S_autoload, S_autolen, FALSE))) return NULL; @@ -635,7 +635,7 @@ Perl_gv_fetchmethod_autoload(pTHX_ HV *stash, const char *name, I32 autoload) name = nsplit + 1; if (*nsplit == ':') --nsplit; - if ((nsplit - origname) == 5 && strnEQ(origname, "SUPER", 5)) { + if ((nsplit - origname) == 5 && memEQ(origname, "SUPER", 5)) { /* ->SUPER::method should really be looked up in original stash */ SV * const tmpstr = sv_2mortal(Perl_newSVpvf(aTHX_ "%s::SUPER", CopSTASHPV(PL_curcop))); @@ -702,7 +702,7 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method) PERL_ARGS_ASSERT_GV_AUTOLOAD4; - if (len == S_autolen && strnEQ(name, S_autoload, S_autolen)) + if (len == S_autolen && memEQ(name, S_autoload, S_autolen)) return NULL; if (stash) { if (SvTYPE(stash) < SVt_PVHV) {