* Patch from Alexey Torgashin to switch to const param strings where possible

This commit is contained in:
Michaël Van Canneyt 2023-08-28 10:24:26 +02:00
parent 2d1e14f778
commit 4822daaa4f
2 changed files with 5 additions and 5 deletions

View File

@ -74,7 +74,7 @@ Type
function GetPosition: Int64; override; function GetPosition: Int64; override;
procedure InvalidSeek; override; procedure InvalidSeek; override;
Public Public
Constructor Create(AKey : UTF8String; Dest: TStream); overload; virtual; Constructor Create(const AKey : UTF8String; Dest: TStream); overload; virtual;
Constructor Create(AKey : TBytes; Dest: TStream); overload; virtual; Constructor Create(AKey : TBytes; Dest: TStream); overload; virtual;
Destructor Destroy; override; Destructor Destroy; override;
end; end;
@ -91,7 +91,7 @@ Type
private private
FSourcePos0: Int64; FSourcePos0: Int64;
public public
Constructor Create(AKey : UTF8String; Dest: TStream); overload; virtual; Constructor Create(const AKey : UTF8String; Dest: TStream); overload; virtual;
Constructor Create(AKey : TBytes; Dest: TStream); overload; virtual; Constructor Create(AKey : TBytes; Dest: TStream); overload; virtual;
function Read(var Buffer; Count: Longint): Longint; override; function Read(var Buffer; Count: Longint): Longint; override;
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override; function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
@ -1022,7 +1022,7 @@ begin
raise EBlowFish2Error.Create(SNoSeekAllowed); raise EBlowFish2Error.Create(SNoSeekAllowed);
end; end;
constructor TBlowFish2Stream.Create(AKey: UTF8String; Dest: TStream); constructor TBlowFish2Stream.Create(const AKey: UTF8String; Dest: TStream);
begin begin
inherited Create(Dest); inherited Create(Dest);
@ -1127,7 +1127,7 @@ begin
FSourcePos0 := Source.Position; FSourcePos0 := Source.Position;
end; end;
Constructor TBlowFish2DeCryptStream.Create(AKey : UTF8String; Dest: TStream); overload; Constructor TBlowFish2DeCryptStream.Create(const AKey : UTF8String; Dest: TStream); overload;
begin begin
inherited Create(AKey, Dest); inherited Create(AKey, Dest);

View File

@ -205,7 +205,7 @@ const
WhitespaceChars = [HTAB, SPACE]; WhitespaceChars = [HTAB, SPACE];
LineEndingChars = [CR, LF]; LineEndingChars = [CR, LF];
Procedure AppendStr(Var Dest : RawByteString; Src : RawByteString); inline; Procedure AppendStr(Var Dest : RawByteString; const Src : RawByteString); inline;
begin begin
Dest:=Dest+Src; Dest:=Dest+Src;