Explorar o código

* fpc_AnsiStr_To_ShortStr: set length before moving, should result in better memory access pattern

florian %!s(int64=3) %!d(string=hai) anos
pai
achega
a7a689ca16
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      rtl/inc/astrings.inc

+ 1 - 1
rtl/inc/astrings.inc

@@ -493,8 +493,8 @@ begin
      Size:=Length(S2);
      Size:=Length(S2);
      If Size>high(res) then
      If Size>high(res) then
       Size:=high(res);
       Size:=high(res);
-     Move (S2[1],res[1],Size);
      byte(res[0]):=byte(Size);
      byte(res[0]):=byte(Size);
+     Move (S2[1],res[1],Size);
    end;
    end;
 end;
 end;
 {$endif FPC_HAS_ANSISTR_TO_SHORTSTR}
 {$endif FPC_HAS_ANSISTR_TO_SHORTSTR}