Patrick wrote:

[...] I also improved utf8_set_position
a bit so that it doesn't always have to restart position
counting from the beginning of the string.  As a result,
compiling the actions.pl script on my machine goes from 39s to
a little over 28s -- about a 25% speed increase.

I have a doubt on utf8_set_position().
I read this:

http://svn.perl.org/viewvc/parrot/trunk/src/encodings/utf8.c?r1=24434&r2=24556

What happens if string already has `i->charpos > pos' ?
Can that ever happen?

[... /me reads again the diff ...]

I realized while writing this that if `i->charpos > pos'.
you simply end up re-scanning the string from the start.
Is that correct?

Maybe it could be an idea to scan backwards in that case?
Please don't yell at me, I'm just trying to follow up :)

--
Cosimo

Reply via email to