mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-19 14:16:46 -06:00
Fixed issue in TextCtrl::Load optimization
git-svn-id: svn://ultimatepp.org/upp/trunk@7521 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
1322a7c166
commit
b42a5efb0e
1 changed files with 7 additions and 4 deletions
|
|
@ -127,9 +127,11 @@ int TextCtrl::Load(Stream& in, byte charset) {
|
|||
{
|
||||
LTIMING("ChkLoop UTF8");
|
||||
while(s < e && (*s >= ' ' || *s == '\t')) {
|
||||
s++;
|
||||
while(s < e && *s >= ' ')
|
||||
b8 |= *s++;
|
||||
while(s < e && *s >= ' ' && *s < 128) // Interestingly, this speeds things up
|
||||
s++;
|
||||
while(s < e && *s >= ' ')
|
||||
b8 |= *s++;
|
||||
}
|
||||
}
|
||||
if(b < s) {
|
||||
|
|
@ -140,9 +142,10 @@ int TextCtrl::Load(Stream& in, byte charset) {
|
|||
cr = true;
|
||||
if(*s == '\n') {
|
||||
LTIMING("ADD");
|
||||
total += ln.GetCount() + 1;
|
||||
int len = (b8 & 0x80) ? utf8len(~ln, ln.GetCount()) : ln.GetCount();
|
||||
total += len + 1;
|
||||
Ln& l = line.Add();
|
||||
l.len = ln.GetCount();
|
||||
l.len = len;
|
||||
l.text = ln;
|
||||
ln.Clear();
|
||||
b8 = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue