diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-11-30 16:16:06 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-11-30 16:16:06 +0000 |
commit | 3a930490e65769165bfdcf1a4fac233cc7f33f3b (patch) | |
tree | 6cfc160aead29419e465dd031a2b7134119ac7fd | |
parent | 269d14b00140f054b182b8805756d994f5e9d828 (diff) | |
download | fpGUI-3a930490e65769165bfdcf1a4fac233cc7f33f3b.tar.xz |
optimised UTF8CStringToUTF8String
-rw-r--r-- | src/corelib/fpg_stringutils.pas | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/fpg_stringutils.pas b/src/corelib/fpg_stringutils.pas index b5ca0993..1f3ce036 100644 --- a/src/corelib/fpg_stringutils.pas +++ b/src/corelib/fpg_stringutils.pas @@ -217,7 +217,6 @@ var Source: PChar; Dest: PChar; SourceEnd: PChar; - CharLen: integer; SourceCopied: PChar; // Copies from SourceStart till Source to Dest and updates Dest @@ -242,8 +241,7 @@ begin SourceEnd := Source + SourceLen; while Source<SourceEnd do begin - CharLen := UTF8CharacterLength(Source); - if (CharLen=1) and (Source^='\') then + if (Source^='\') then begin CopyPart; inc(Source); @@ -272,7 +270,7 @@ begin SourceCopied := Source; end else - Inc(Source, CharLen); + Inc(Source, UTF8CharacterLength(Source)); end; CopyPart; SetLength(Result, Dest - PChar(Result)); |