diff options
author | SADAHIRO Tomoyuki <BQW10602@nifty.com> | 2005-12-05 01:24:29 +0900 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-12-05 15:25:00 +0000 |
commit | 680c470ce925e5af5a9ca87f342016c7363e36fd (patch) | |
tree | 9bcd37c7ca94eaf41940e542bddb21790457e316 /utf8.c | |
parent | 660a461690361c615b3b45ef731dd3d6f0d55d01 (diff) | |
download | perl-680c470ce925e5af5a9ca87f342016c7363e36fd.tar.gz |
Better variable names make code clearer
Subject: Re: XS-assisted SWASHGET (esp. for t/uni/class.t speedup)
Message-Id: <20051204162412.D720.BQW10602@nifty.com>
p4raw-id: //depot/perl@26257
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1626,11 +1626,18 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits * the lower-level routine, and it is similarly broken for returning * multiple values. --jhi */ /* Now SWASHGET is recasted into S_swash_get in this file. */ + +/* Note: + * Returns the value of property/mapping C<swash> for the first character + * of the string C<ptr>. If C<do_utf8> is true, the string C<ptr> is + * assumed to be in utf8. If C<do_utf8> is false, the string C<ptr> is + * assumed to be in native 8-bit encoding. Caches the swatch in C<swash>. + */ UV -Perl_swash_fetch(pTHX_ SV *sv, const U8 *ptr, bool do_utf8) +Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8) { dVAR; - HV* const hv = (HV*)SvRV(sv); + HV* const hv = (HV*)SvRV(swash); U32 klen; U32 off; STRLEN slen; @@ -1696,7 +1703,7 @@ Perl_swash_fetch(pTHX_ SV *sv, const U8 *ptr, bool do_utf8) const UV code_point = utf8n_to_uvuni(ptr, UTF8_MAXBYTES, 0, ckWARN(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY); - swatch = swash_get(sv, + swatch = swash_get(swash, /* On EBCDIC & ~(0xA0-1) isn't a useful thing to do */ (klen) ? (code_point & ~(needents - 1)) : 0, needents); |