Skip to content

Commit

Permalink
micro optim
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Oct 20, 2019
1 parent 303fe24 commit 00bcad6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions python4lazarus/Sources/Core/PythonEngine.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3640,7 +3640,11 @@ function TPythonInterface.GetUnicodeTypeSuffix : String;
end;

procedure TPythonInterface.MapDll;
var
UnicodeSuffix: string;
begin
UnicodeSuffix:= GetUnicodeTypeSuffix;

Py_DebugFlag := Import('Py_DebugFlag');
Py_VerboseFlag := Import('Py_VerboseFlag');
Py_InteractiveFlag := Import('Py_InteractiveFlag');
Expand Down Expand Up @@ -4051,12 +4055,12 @@ procedure TPythonInterface.MapDll;
PyType_GenericAlloc :=Import('PyType_GenericAlloc');
PyType_GenericNew :=Import('PyType_GenericNew');
PyType_Ready :=Import('PyType_Ready');
PyUnicode_FromWideChar :=Import(Format('PyUnicode%s_FromWideChar',[GetUnicodeTypeSuffix]));
PyUnicode_AsWideChar :=Import(Format('PyUnicode%s_AsWideChar',[GetUnicodeTypeSuffix]));
PyUnicode_Decode :=Import(Format('PyUnicode%s_Decode',[GetUnicodeTypeSuffix]));
PyUnicode_AsEncodedString :=Import(Format('PyUnicode%s_AsEncodedString',[GetUnicodeTypeSuffix]));
PyUnicode_FromOrdinal :=Import(Format('PyUnicode%s_FromOrdinal',[GetUnicodeTypeSuffix]));
PyUnicode_GetSize :=Import(Format('PyUnicode%s_GetSize',[GetUnicodeTypeSuffix]));
PyUnicode_FromWideChar :=Import(Format('PyUnicode%s_FromWideChar',[UnicodeSuffix]));
PyUnicode_AsWideChar :=Import(Format('PyUnicode%s_AsWideChar',[UnicodeSuffix]));
PyUnicode_Decode :=Import(Format('PyUnicode%s_Decode',[UnicodeSuffix]));
PyUnicode_AsEncodedString :=Import(Format('PyUnicode%s_AsEncodedString',[UnicodeSuffix]));
PyUnicode_FromOrdinal :=Import(Format('PyUnicode%s_FromOrdinal',[UnicodeSuffix]));
PyUnicode_GetSize :=Import(Format('PyUnicode%s_GetSize',[UnicodeSuffix]));
PyWeakref_GetObject :=Import('PyWeakref_GetObject');
PyWeakref_NewProxy :=Import('PyWeakref_NewProxy');
PyWeakref_NewRef :=Import('PyWeakref_NewRef');
Expand Down

0 comments on commit 00bcad6

Please sign in to comment.