# New Ticket Created by  Vasily Chekalkin 
# Please include the string:  [perl #59476]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59476 >


Hello.

There is suggestion from Pm for Str.capitalize

 > +
 > > +=item capitalize
 > > + [...]
 > > +=cut
 > > +
 > > +    .local int pos, is_ws, is_lc
 > > +    pos = 0
 > > +    goto first_char
 > > +  next_grapheme:
 > > +    if pos == len goto done
 > > +    is_ws = is_cclass .CCLASS_WHITESPACE, tmps, pos
 > > +    if is_ws goto ws
 > > +  advance:
 > > +    pos += 1
 > > +    goto next_grapheme
 > > +  ws:
 > > +    pos += 1
 > > +  first_char:
 > > +    is_lc = is_cclass .CCLASS_LOWERCASE, tmps, pos
 > > +    unless is_lc goto advance
 > > ...

This section of code would be much simpler (and more efficient)
by using the C<find_cclass> and C<find_not_cclass opcodes> instead of
individually examining each character one-at-a-time.



-- 
Bacek

Reply via email to