From 19a540392dc1dea55a673834a3c690d1dd5dee6a Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 7 Oct 2024 10:50:41 -0600 Subject: [PATCH] regexec.c: Remove no-value-added function This function merely calls an inline one. Might as well not have any indirection. --- embed.fnc | 4 ---- embed.h | 1 - proto.h | 6 ------ regexec.c | 10 +--------- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/embed.fnc b/embed.fnc index f0d1dedb1485..acc4b825a01c 100644 --- a/embed.fnc +++ b/embed.fnc @@ -5575,10 +5575,6 @@ ESW |void |regcp_restore |NN regexp *rex \ ERST |U8 * |reghop3 |NN U8 *s \ |SSize_t off \ |NN const U8 *lim -ERST |U8 * |reghop4 |NN U8 *s \ - |SSize_t off \ - |NN const U8 *llim \ - |NN const U8 *rlim ERST |U8 * |reghopmaybe3 |NN U8 *s \ |SSize_t off \ |NN const U8 * const lim diff --git a/embed.h b/embed.h index 8f890fba4df4..74aaea51bcd5 100644 --- a/embed.h +++ b/embed.h @@ -1987,7 +1987,6 @@ # define regcppop(a,b) S_regcppop(aTHX_ a,b comma_aDEPTH) # define regcppush(a,b,c) S_regcppush(aTHX_ a,b,c comma_aDEPTH) # define reghop3 S_reghop3 -# define reghop4 S_reghop4 # define reghopmaybe3 S_reghopmaybe3 # define reginclass(a,b,c,d,e) S_reginclass(aTHX_ a,b,c,d,e) # define regmatch(a,b,c) S_regmatch(aTHX_ a,b,c) diff --git a/proto.h b/proto.h index 65fe5c5bd68c..a521122afc8a 100644 --- a/proto.h +++ b/proto.h @@ -8790,12 +8790,6 @@ S_reghop3(U8 *s, SSize_t off, const U8 *lim) # define PERL_ARGS_ASSERT_REGHOP3 \ assert(s); assert(lim) -STATIC U8 * -S_reghop4(U8 *s, SSize_t off, const U8 *llim, const U8 *rlim) - __attribute__warn_unused_result__; -# define PERL_ARGS_ASSERT_REGHOP4 \ - assert(s); assert(llim); assert(rlim) - STATIC U8 * S_reghopmaybe3(U8 *s, SSize_t off, const U8 * const lim) __attribute__warn_unused_result__; diff --git a/regexec.c b/regexec.c index 2a71f77c5f03..32c641cb242a 100644 --- a/regexec.c +++ b/regexec.c @@ -164,7 +164,7 @@ static const char non_utf8_target_but_utf8_required[] #define HOP3clim(pos,off,lim) ((char*)HOP3lim(pos,off,lim)) #define HOP4(pos,off,llim, rlim) (reginfo->is_utf8_target \ - ? reghop4((U8*)(pos), off, (U8*)(llim), (U8*)(rlim)) \ + ? utf8_hop_safe((U8*)(pos), off, (U8*)(llim), (U8*)(rlim)) \ : (U8*)(pos + off)) #define HOP4c(pos,off,llim, rlim) ((char*)HOP4(pos,off,llim, rlim)) @@ -11158,14 +11158,6 @@ S_reghop3(U8 *s, SSize_t off, const U8* lim) return s; } -STATIC U8 * -S_reghop4(U8 *s, SSize_t off, const U8* llim, const U8* rlim) -{ - PERL_ARGS_ASSERT_REGHOP4; - - return utf8_hop_safe(s, off, llim, rlim); -} - /* like reghop3, but returns NULL on overrun, rather than returning last * char pos */