From 5af5b232a2dc0e42e74fa716f7cf429ba9e386ac Mon Sep 17 00:00:00 2001 From: Richard Leach Date: Mon, 13 Jun 2022 11:41:42 +0000 Subject: pp_aelemfast: include fast return for non-lvals Within the "inlined av_fetch() for simple cases" fast path, we already operate within the bounding conditions of the if() statement. Once AvARRAY(av)[key] is found to be null, a call of av_fetch(av,key,lval) here just boils down to a single line: return lval ? av_store(av,key,newSV_type(SVt_NULL)) : NULL; Checking the rest of pp_aelemfast, it's clear that within the fast path, if (!sv) and (!lval), the function must eventually PUSHs(&PL_sv_undef). So the fast path might as well do that directly. --- pp_hot.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pp_hot.c') diff --git a/pp_hot.c b/pp_hot.c index d3a0aa1770..2ec4bbc4eb 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1637,6 +1637,9 @@ PP(pp_aelemfast) if (sv) { PUSHs(sv); RETURN; + } else if (!lval) { + PUSHs(&PL_sv_undef); + RETURN; } } -- cgit v1.2.1