summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2018-02-18 02:57:39 -0500
committerTony Cook <tony@develop-help.com>2018-03-01 10:41:36 +1100
commit1c8104f6f402c92bd12af877323398749dec28a8 (patch)
treed2c2d4cd06f16275ee4d601bfb413c90bd6326a3 /sv.c
parenta2d15b8e6535fde483485731bed6021643860765 (diff)
downloadperl-1c8104f6f402c92bd12af877323398749dec28a8.tar.gz
remove unused var in sv_eq_flags
svrecode became unused in commit 8df0e7a28b "Remove IN_ENCODING macro, and all code dependent on it" but there was still a SvREFCNT_dec(NULL) executed at the end of the function. This commit will reduce size of Perl_sv_eq_flags by the CC not having to save var eq to a non-volatile register or stack location around the SvREFCNT_dec func call and instead store var eq in the return register directly. Also remove the eq var completly, since initializing the var so early means it has to be stored on the stack around alot func calls, so just do a direct return of const zero on the only "fall off the end" path in the func.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sv.c b/sv.c
index 1aa5966489..2475d46bf5 100644
--- a/sv.c
+++ b/sv.c
@@ -7802,8 +7802,6 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
STRLEN cur1;
const char *pv2;
STRLEN cur2;
- I32 eq = 0;
- SV* svrecode = NULL;
if (!sv1) {
pv1 = "";
@@ -7843,11 +7841,9 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
}
if (cur1 == cur2)
- eq = (pv1 == pv2) || memEQ(pv1, pv2, cur1);
-
- SvREFCNT_dec(svrecode);
-
- return eq;
+ return (pv1 == pv2) || memEQ(pv1, pv2, cur1);
+ else
+ return 0;
}
/*