summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-01-28 13:38:28 +0000
committerNicholas Clark <nick@ccl4.org>2006-01-28 13:38:28 +0000
commit4f2da183afece5ce28d1dcdb66d8d931eb0d976a (patch)
tree0ac0c94cde46c822be65a07383ae61e30a90a9dd /sv.h
parentb8473700d76df372cb0ff6b7c4953731e2d985c2 (diff)
downloadperl-4f2da183afece5ce28d1dcdb66d8d931eb0d976a.tar.gz
By changing SvVOK() from returning 0/1 to 0/pointer-to-magic we can
save duplicating mg_find calls, without changing the semantics in any boolean context. p4raw-id: //depot/perl@26979
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.h b/sv.h
index 58c078f3e9..d8597ad001 100644
--- a/sv.h
+++ b/sv.h
@@ -751,7 +751,8 @@ in gv.h: */
SVf_IVisUV), \
SvFLAGS(sv) |= (SVf_POK|SVp_POK))
-#define SvVOK(sv) (SvMAGICAL(sv) && mg_find(sv,'V'))
+#define SvVOK(sv) (SvMAGICAL(sv) \
+ ? mg_find(sv,PERL_MAGIC_vstring) : NULL)
#define SvOOK(sv) (SvFLAGS(sv) & SVf_OOK)
#define SvOOK_on(sv) ((void)SvIOK_off(sv), SvFLAGS(sv) |= SVf_OOK)
#define SvOOK_off(sv) ((void)(SvOOK(sv) && sv_backoff(sv)))