summaryrefslogtreecommitdiff
path: root/ext/B/B.xs
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-11-07 15:03:43 +0000
committerNicholas Clark <nick@ccl4.org>2010-11-08 07:55:09 +0000
commit81e413dd293ca530aa3b6f9cd587b94ada3bd0a0 (patch)
tree7f469682c5877f1f6ee003047a73d134f99cc7c3 /ext/B/B.xs
parent154b88420588b0827f180ef3f77658ea35d8b3e7 (diff)
downloadperl-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.xs21
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