Changeset 225

Show
Ignore:
Timestamp:
08/30/01 15:10:48
Author:
miyagawa
Message:

improved performance

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • HTML-Entities-ImodePictogram/trunk/Changes

    r224 r225  
    11Revision history for Perl extension HTML::Entities::ImodePictogram. 
     2 
     30.04  Thu Aug 30 15:09:47 JST 2001 
     4        - Performance improved (slightly efficient regex matching) 
    25 
    360.03  Thu Aug 30 14:14:15 JST 2001 
  • HTML-Entities-ImodePictogram/trunk/lib/HTML/Entities/ImodePictogram.pm

    r224 r225  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = '0.03'; 
     5$VERSION = '0.04'; 
    66 
    77use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); 
     
    1515my $two_bytes = '[\x81-\x9F\xE0-\xFC][\x40-\x7E\x80-\xFC]'; 
    1616 
    17 use vars qw($Pictogram_re $Sjis_re); 
     17use vars qw($Sjis_re $Pictogram_re); 
     18$Sjis_re      = qr<$one_byte|$two_bytes>; 
    1819$Pictogram_re = '\xF8[\x9F-\xFC]|\xF9[\x40-\x7E\x80-\xAF]'; 
    19 $Sjis_re      = qr<$one_byte|$two_bytes|$Pictogram_re>; 
    2020 
    2121sub find_pictogram (\$&) { 
     
    2323 
    2424    my $num_found = 0; 
    25     $$r_text =~ s{($Sjis_re)}{ 
     25    $$r_text =~ s{(($Pictogram_re)|$Sjis_re)}{ 
    2626        my $orig_match = $1; 
    27         if ($orig_match =~ /^$Pictogram_re$/) { 
     27        if (defined $2) { 
    2828            $num_found++; 
    2929            $callback->($orig_match, unpack('n', $orig_match));