Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-09

not optimal code (need Move) in RegExpr unit

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey
function StrPCopy (Dest: PRegExprChar; const Source: RegExprString):
PRegExprChar;
  var
   i, Len : PtrInt;
  begin
   Len := length (Source); //###0.932
   for i := 1 to Len do
    Dest [i - 1] := Source [i];
   Dest [Len] := #0;
   Result := Dest;
  end; { of function StrPCopy
--------------------------------------------------------------}
function StrLCopy (Dest, Source: PRegExprChar; MaxLen: PtrUInt):
PRegExprChar;
  var i: PtrInt;
  begin
   for i := 0 to MaxLen - 1 do
    Dest [i] := Source [i];
   Result := Dest;
  end; { of function StrLCopy
--------------------------------------------------------------}
Regards, Alexey

Reply by email