Codebase list libhtml-parser-perl / c5c1b06
Compute hash only once. gisle 20 years ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
0 /* $Id: hparser.c,v 2.94 2004/04/01 11:47:27 gisle Exp $
0 /* $Id: hparser.c,v 2.95 2004/04/01 11:56:37 gisle Exp $
11 *
22 * Copyright 1999-2002, Gisle Aas
33 * Copyright 1999-2000, Michael A. Chase
413413 sv_lower(aTHX_ attrname);
414414
415415 if (argcode == ARG_ATTR) {
416 if (hv_exists_ent(hv, attrname, 0) ||
417 !hv_store_ent(hv, attrname, attrval, 0)) {
416 U32 hash;
417 PERL_HASH(hash, SvPVX(attrname), SvCUR(attrname));
418 if (hv_exists_ent(hv, attrname, hash) ||
419 !hv_store_ent(hv, attrname, attrval, hash)) {
418420 SvREFCNT_dec(attrval);
419421 }
420422 SvREFCNT_dec(attrname);