This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
B::cchar can be implemented as an ALIAS of B::cstring.
authorNicholas Clark <nick@ccl4.org>
Sun, 24 Oct 2010 13:51:05 +0000 (15:51 +0200)
committerNicholas Clark <nick@ccl4.org>
Sun, 24 Oct 2010 13:51:05 +0000 (15:51 +0200)
ext/B/B.xs

index 5b1688a..138ec05 100644 (file)
@@ -807,14 +807,9 @@ cstring(sv)
        SV *    sv
     ALIAS:
        perlstring = 1
+       cchar = 2
     PPCODE:
-       PUSHs(cstring(aTHX_ sv, ix));
-
-SV *
-cchar(sv)
-       SV *    sv
-    PPCODE:
-       PUSHs(cchar(aTHX_ sv));
+       PUSHs(ix == 2 ? cchar(aTHX_ sv) : cstring(aTHX_ sv, ix));
 
 void
 threadsv_names()