Browse Source

* avoid unique call in ansistr_append

git-svn-id: trunk@1968 -
florian 19 years ago
parent
commit
da9469c550
1 changed files with 6 additions and 4 deletions
  1. 6 4
      rtl/inc/astrings.inc

+ 6 - 4
rtl/inc/astrings.inc

@@ -86,7 +86,7 @@ begin
 end;
 end;
 
 
 {$ifndef FPC_SYSTEM_HAS_ANSISTR_DECR_REF}
 {$ifndef FPC_SYSTEM_HAS_ANSISTR_DECR_REF}
-Procedure fpc_AnsiStr_Decr_Ref (Var S : Pointer); [Public,Alias:'FPC_ANSISTR_DECR_REF'];  compilerproc;
+Procedure fpc_ansistr_decr_ref (Var S : Pointer); [Public,Alias:'FPC_ANSISTR_DECR_REF'];  compilerproc;
 {
 {
   Decreases the ReferenceCount of a non constant ansistring;
   Decreases the ReferenceCount of a non constant ansistring;
   If the reference count is zero, deallocate the string;
   If the reference count is zero, deallocate the string;
@@ -110,7 +110,7 @@ end;
 {$endif FPC_SYSTEM_HAS_ANSISTR_DECR_REF}
 {$endif FPC_SYSTEM_HAS_ANSISTR_DECR_REF}
 
 
 { also define alias for internal use in the system unit }
 { also define alias for internal use in the system unit }
-Procedure fpc_AnsiStr_Decr_Ref (Var S : Pointer); [external name 'FPC_ANSISTR_DECR_REF'];
+Procedure fpc_ansistr_decr_ref (Var S : Pointer); [external name 'FPC_ANSISTR_DECR_REF'];
 
 
 Procedure fpc_AnsiStr_Incr_Ref (S : Pointer); [Public,Alias:'FPC_ANSISTR_INCR_REF'];  compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 Procedure fpc_AnsiStr_Incr_Ref (S : Pointer); [Public,Alias:'FPC_ANSISTR_INCR_REF'];  compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 Begin
 Begin
@@ -463,7 +463,8 @@ begin
      exit;
      exit;
    ofs:=Length(S);
    ofs:=Length(S);
    SetLength(S,ofs+length(Str));
    SetLength(S,ofs+length(Str));
-   move(Str[1],S[ofs+1],length(Str));
+   { the pbyte cast avoids an unique call which isn't necessary because SetLength was just called }
+   move(Str[1],(pointer(S)+ofs)^,length(Str));
    PByte(Pointer(S)+length(S))^:=0; { Terminating Zero }
    PByte(Pointer(S)+length(S))^:=0; { Terminating Zero }
 end;
 end;
 
 
@@ -477,7 +478,8 @@ begin
    strlength := length(str);
    strlength := length(str);
    ofs:=Length(S);
    ofs:=Length(S);
    SetLength(S,ofs+length(Str));
    SetLength(S,ofs+length(Str));
-   move(Str[1],S[ofs+1],strlength+1);
+   { the pbyte cast avoids an unique call which isn't necessary because SetLength was just called }
+   move(Str[1],(pointer(S)+ofs)^,strlength+1);
 end;
 end;
 
 
 Function Fpc_Ansistr_Copy (Const S : AnsiString; Index,Size : SizeInt) : AnsiString;compilerproc;
 Function Fpc_Ansistr_Copy (Const S : AnsiString; Index,Size : SizeInt) : AnsiString;compilerproc;