From b59bf0b2884b21b6f3ce5eca607ab7a6096d87f5 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 31 Oct 2017 08:30:38 -0600 Subject: Use memEQs, memNEs in core files Where the length is known, we can use these functions which relieve the programmer and the program reader from having to count characters. The memFOO functions should also be slightly faster than the strFOO equivalents. In some instances in this commit, hard coded numbers are used. These come from the 'case' statement values that apply to them. --- hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hv.c') diff --git a/hv.c b/hv.c index 04129f8138..d3d02d1046 100644 --- a/hv.c +++ b/hv.c @@ -1279,7 +1279,7 @@ S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, sv_2mortal((SV *)gv) ); } - else if (klen == 3 && strBEGINs(key, "ISA") && GvAV(gv)) { + else if (memEQs(key, klen, "ISA") && GvAV(gv)) { AV *isa = GvAV(gv); MAGIC *mg = mg_find((SV*)isa, PERL_MAGIC_isa); -- cgit v1.2.1