diff options
author | Karl Williamson <khw@cpan.org> | 2017-11-17 21:59:59 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-11-26 10:17:29 -0700 |
commit | f60f61fd47355f97bcac52e6e93e5cba818d1796 (patch) | |
tree | cea0267165d08c8cb7db7599847ce0c6beb05f01 /proto.h | |
parent | bb1b88dd7be03975ef001e007081e75d83f8cb6f (diff) | |
download | perl-f60f61fd47355f97bcac52e6e93e5cba818d1796.tar.gz |
inline.h: Avoid some extra strlen()
The API of these functions says that if the length is 0, strlen() is
called to compute it. In several cases, control is handed off to a
function using 0, throwing away the already-computed length. Change
to use the computed length when calling the functions, avoiding the
issue.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1692,7 +1692,7 @@ PERL_STATIC_INLINE bool Perl_is_utf8_string(const U8 *s, const STRLEN len) #endif #ifndef PERL_NO_INLINE_FUNCTIONS -PERL_STATIC_INLINE bool S_is_utf8_string_flags(const U8 *s, const STRLEN len, const U32 flags) +PERL_STATIC_INLINE bool S_is_utf8_string_flags(const U8 *s, STRLEN len, const U32 flags) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_IS_UTF8_STRING_FLAGS \ assert(s) @@ -1703,14 +1703,14 @@ PERL_CALLCONV bool Perl_is_utf8_string_loc(const U8 *s, const STRLEN len, const #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOC \ assert(s); assert(ep) #endif -/* PERL_CALLCONV bool is_utf8_string_loc_flags(const U8 *s, const STRLEN len, const U8 **ep, const U32 flags); */ +/* PERL_CALLCONV bool is_utf8_string_loc_flags(const U8 *s, STRLEN len, const U8 **ep, const U32 flags); */ #ifndef PERL_NO_INLINE_FUNCTIONS -PERL_STATIC_INLINE bool Perl_is_utf8_string_loclen(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el); +PERL_STATIC_INLINE bool Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el); #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN \ assert(s) #endif #ifndef PERL_NO_INLINE_FUNCTIONS -PERL_STATIC_INLINE bool S_is_utf8_string_loclen_flags(const U8 *s, const STRLEN len, const U8 **ep, STRLEN *el, const U32 flags); +PERL_STATIC_INLINE bool S_is_utf8_string_loclen_flags(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el, const U32 flags); #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN_FLAGS \ assert(s) #endif |