From 1f39a1cc3caa318807586d74a8f8b34adbdb1371 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Sun, 18 Mar 2018 13:45:55 +0100 Subject: DTCallback: Enable fast callbacks also if refs == [] (needed to enable fast callbacks inside BindCallback) --- DTCallback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DTCallback.c b/DTCallback.c index 820dfb7..f95ff92 100644 --- a/DTCallback.c +++ b/DTCallback.c @@ -5,7 +5,7 @@ static const CallbackTarget_Bind = -1; static const CallbackTarget_Global = -2; static const CallbackTarget_Scenario = -3; -// NOTE: fast callbacks (fast = true for ObjectCallback or DefinitionCallback) use ObjectCall/DefinitionCall directly for greater performance if possible (refs = 0 and GetLength(args) <= 8 for CallA()) and thus must be real functions of the desired object/definition. safe mode is ignored for fast callbacks +// NOTE: fast callbacks (fast = true for ObjectCallback or DefinitionCallback) use ObjectCall/DefinitionCall directly for greater performance if possible (refs == 0 and GetLength(args) <= 8 for CallA()) and thus must be real functions of the desired object/definition. safe mode is ignored for fast callbacks global func GlobalCallback(string name) { return [CallbackTarget_Global, name]; } global func ScenarioCallback(string name) { return [CallbackTarget_Scenario, name]; } @@ -60,7 +60,7 @@ global func CallA(callback, args, bool safe, array refs) var target = callback[0], function = callback[1]; - if((GetType(target) == C4V_C4Object || GetType(target) == C4V_C4ID) && GetLength(callback) == 3 && callback[2] && !refs && GetLength(args) <= 8) // fast callback + if((GetType(target) == C4V_C4Object || GetType(target) == C4V_C4ID) && GetLength(callback) == 3 && callback[2] && (!refs || refs == []) && GetLength(args) <= 8) // fast callback { if(GetType(target) == C4V_C4Object) { -- cgit v1.2.3-54-g00ecf