mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-22 16:09:13 +02:00
* small speed improvements
git-svn-id: trunk@2634 -
This commit is contained in:
parent
0cc2b9b16b
commit
0f55bd3d42
@ -351,10 +351,11 @@ begin
|
||||
begin
|
||||
if Pointer(S)=nil then
|
||||
begin
|
||||
{ Need a complete new string...}
|
||||
Pointer(s):=NewAnsiString(l);
|
||||
GetMem(Pointer(S),AnsiRecLen+L);
|
||||
PAnsiRec(S)^.Ref:=1;
|
||||
inc(Pointer(S),firstoff);
|
||||
end
|
||||
else if (PAnsiRec(Pointer(S)-FirstOff)^.Ref = 1) then
|
||||
else if PAnsiRec(Pointer(S)-FirstOff)^.Ref=1 then
|
||||
begin
|
||||
Dec(Pointer(S),FirstOff);
|
||||
if AnsiRecLen+L>MemSize(Pointer(s)) then
|
||||
@ -485,7 +486,7 @@ begin
|
||||
{ needed in case s and str are the same string }
|
||||
strlength := length(str);
|
||||
ofs:=Length(S);
|
||||
SetLength(S,ofs+length(Str));
|
||||
SetLength(S,ofs+strlength);
|
||||
{ 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;
|
||||
|
Loading…
Reference in New Issue
Block a user