Browse Source

rtl: accelerated StringOf

mattias 6 years ago
parent
commit
bea50b5047
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/rtl/sysutils.pas

+ 2 - 2
packages/rtl/sysutils.pas

@@ -2001,9 +2001,9 @@ function StringOf(const ABytes: TBytes): string;
 var
 var
   I: Integer;
   I: Integer;
 begin
 begin
-  SetLength(Result, Length(ABytes));
+  Result:='';
   for I := 0 to Length(ABytes)-1 do
   for I := 0 to Length(ABytes)-1 do
-    Result[I+1] := Char(ABytes[I]);
+    Result:=Result+Char(ABytes[I]);
 end;
 end;
 
 
 function LocaleCompare(const s1, s2, locales: String): Boolean; assembler;
 function LocaleCompare(const s1, s2, locales: String): Boolean; assembler;