This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Initial experiment at moving SvTRUE into a static inline macro
[perl5.git] / inline.h
index e4bd680..a3df1a3 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -195,6 +195,11 @@ Perl_ReANY(const REGEXP * const re)
 
 /* ------------------------------- sv.h ------------------------------- */
 
+PERL_STATIC_INLINE bool
+Perl_SvTRUE(SV *sv) {
+    return LIKELY(sv) && SvTRUE_NN(sv);
+}
+
 PERL_STATIC_INLINE SV *
 Perl_SvREFCNT_inc(SV *sv)
 {