fix another boundary case and hopefully improve performance
authorTony Cook <tony@develop-help.com>
Sat, 17 Mar 2012 01:54:17 +0000 (12:54 +1100)
committerTony Cook <tony@develop-help.com>
Sat, 8 Dec 2012 22:32:45 +0000 (09:32 +1100)
commita1aea1fe12c11cc8f3650979df95e88a810f3238
treef778adf8468e0aefabfec86fb2d3aca4deaeb143
parent90f6536b6e4fefdbe12a64f4201c9f73580aab88
fix another boundary case and hopefully improve performance

The fix: the if we found ourselves at a charstart with only one
character to read, readsize would be zero, handle that correctly.

Performance: originally I read just the first byte of the next
character, which meant as many extra read calls as there are
characters left to read after the initial read.  So O(Nleft) reads
where Nleft is the number of characters left to read after the initial
read.

Now read as many bytes as there are characters left to read, which
should mean the number of reads comes down to O(log(Nleft**2)) I think
(but don't ask me to justify that.)
sv.c
t/io/utf8.t