Skip to content

Commit e53abec

Browse files
committed
const is faster
1 parent cf91b5f commit e53abec

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Source/WrapDelphi.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ TPyDelphiWrapper = class(TEngineClient, IFreeNotificationSubscriber)
836836
function RegisterHelperType(APyObjectClass : TPyObjectClass) : TPythonType;
837837
function RegisterFunction(AFuncName : PAnsiChar; AFunc : PyCFunction; ADocString : PAnsiChar ): PPyMethodDef; overload;
838838
function RegisterFunction(AFuncName : PAnsiChar; AFunc : TDelphiMethod; ADocString : PAnsiChar ): PPyMethodDef; overload;
839-
function GetHelperType(TypeName : string) : TPythonType;
839+
function GetHelperType(const TypeName : string) : TPythonType;
840840
// Function that provides a Python object wrapping an object
841841
function Wrap(AObj : TObject; AOwnership: TObjectOwnership = soReference) : PPyObject;
842842
{$IFDEF EXTENDED_RTTI}
@@ -845,7 +845,7 @@ TPyDelphiWrapper = class(TEngineClient, IFreeNotificationSubscriber)
845845
// Function that provides a Python object wrapping an interface
846846
// Note the the interface must be compiled in {$M+} mode and have a guid
847847
// Usage: WrapInterface(TValue.From(YourInterfaceReference))
848-
function WrapInterface(IValue: TValue): PPyObject;
848+
function WrapInterface(const IValue: TValue): PPyObject;
849849
{$ENDIF}
850850
// properties
851851
property EventHandlers : TEventHandlers read fEventHandlerList;
@@ -1892,7 +1892,7 @@ function GetRttiAttr(ParentAddr: Pointer; ParentType: TRttiStructuredType;
18921892
end;
18931893

18941894
function SetRttiAttr(const ParentAddr: Pointer; ParentType: TRttiStructuredType;
1895-
AttrName: string; Value: PPyObject; PyDelphiWrapper: TPyDelphiWrapper;
1895+
const AttrName: string; Value: PPyObject; PyDelphiWrapper: TPyDelphiWrapper;
18961896
out ErrMsg: string): Boolean;
18971897
var
18981898
Prop: TRttiProperty;
@@ -3562,7 +3562,7 @@ procedure TPyDelphiWrapper.Finalize;
35623562
fEventHandlerList.Clear;
35633563
end;
35643564

3565-
function TPyDelphiWrapper.GetHelperType(TypeName: string): TPythonType;
3565+
function TPyDelphiWrapper.GetHelperType(const TypeName: string): TPythonType;
35663566
var
35673567
Index : integer;
35683568
begin
@@ -3780,7 +3780,7 @@ function TPyDelphiWrapper.WrapRecord(Address: Pointer; Typ: TRttiStructuredType)
37803780
end;
37813781
end;
37823782

3783-
function TPyDelphiWrapper.WrapInterface(IValue: TValue): PPyObject;
3783+
function TPyDelphiWrapper.WrapInterface(const IValue: TValue): PPyObject;
37843784
var
37853785
PythonType: TPythonType;
37863786
Address: Pointer;

Source/WrapFireDAC.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ TPyFireDACRegistration = class(TRegisteredUnit)
175175
procedure DefineVars(APyDelphiWrapper : TPyDelphiWrapper); override;
176176
end;
177177

178-
function SqlTimeToVarDate(V : Variant) : Variant;
178+
function SqlTimeToVarDate(const V : Variant) : Variant;
179179

180180
implementation
181181

@@ -2230,7 +2230,7 @@ procedure TPyFireDACRegistration.RegisterWrappers(
22302230
APyDelphiWrapper.RegisterDelphiWrapper(TPyDBField);
22312231
end;
22322232

2233-
function SqlTimeToVarDate(V : Variant) : Variant;
2233+
function SqlTimeToVarDate(const V : Variant) : Variant;
22342234
begin
22352235
if VarIsSQLTimeStamp(V) or VarIsSQLTimeStampOffset(V) then
22362236
VarCast(Result, V, varDate)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy