diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-11-07 15:03:43 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-11-08 07:55:09 +0000 |
commit | 81e413dd293ca530aa3b6f9cd587b94ada3bd0a0 (patch) | |
tree | 7f469682c5877f1f6ee003047a73d134f99cc7c3 /ext/B/B.xs | |
parent | 154b88420588b0827f180ef3f77658ea35d8b3e7 (diff) | |
download | perl-81e413dd293ca530aa3b6f9cd587b94ada3bd0a0.tar.gz |
Merge the implementation of B::REGEXP::{REGEXP,precomp} using ALIAS.
Diffstat (limited to 'ext/B/B.xs')
-rw-r--r-- | ext/B/B.xs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs index 813ad8ff10..fa72c9ee47 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1582,20 +1582,19 @@ SvRV(sv) MODULE = B PACKAGE = B::REGEXP -IV -REGEX(sv) - B::REGEXP sv - CODE: - /* FIXME - can we code this method more efficiently? */ - RETVAL = PTR2IV(sv); - OUTPUT: - RETVAL - void -precomp(sv) +REGEX(sv) B::REGEXP sv + ALIAS: + precomp = 1 PPCODE: - PUSHs(newSVpvn_flags(RX_PRECOMP(sv), RX_PRELEN(sv), SVs_TEMP)); + if (ix) { + PUSHs(newSVpvn_flags(RX_PRECOMP(sv), RX_PRELEN(sv), SVs_TEMP)); + } else { + dXSTARG; + /* FIXME - can we code this method more efficiently? */ + PUSHi(PTR2IV(sv)); + } #endif |