Commit 2454657903 for perl
commit 245465790346cc517051d1e50cb8f8adca88561b
Author: Tony Cook <tony@develop-help.com>
Date: Tue Dec 1 10:50:27 2026 +1100
hv_common: remove two useless conditionals
For the first case HeVAL(entry) is assigned to just before the return,
so entry is obviously non-NULL. bulk88 pointed this case out in #p5p.
For the other case HeVAL(entry) is assigned to approximately 60 lines
before the return, with nothing else modifying entry, so entry is
non-NULL.
diff --git a/hv.c b/hv.c
index 897f97e063..742059699a 100644
--- a/hv.c
+++ b/hv.c
@@ -602,7 +602,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
Safefree(key);
if (return_svp) {
- return entry ? (void *) &HeVAL(entry) : NULL;
+ return (void *) &HeVAL(entry);
}
return (void *) entry;
}
@@ -1132,7 +1132,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
}
if (return_svp) {
- return entry ? (void *) &HeVAL(entry) : NULL;
+ return (void *) &HeVAL(entry);
}
return (void *) entry;
}