From 00bcad665622b66ce88851ea98f978bc29e52662 Mon Sep 17 00:00:00 2001 From: Alexey-t Date: Sun, 20 Oct 2019 09:27:37 +0300 Subject: [PATCH] micro optim --- python4lazarus/Sources/Core/PythonEngine.pas | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/python4lazarus/Sources/Core/PythonEngine.pas b/python4lazarus/Sources/Core/PythonEngine.pas index 7a999f7..844189d 100644 --- a/python4lazarus/Sources/Core/PythonEngine.pas +++ b/python4lazarus/Sources/Core/PythonEngine.pas @@ -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'); @@ -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');