diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2018-03-18 13:45:55 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2018-03-18 13:45:55 +0100 |
| commit | 1f39a1cc3caa318807586d74a8f8b34adbdb1371 (patch) | |
| tree | 8eff0ab114de59000b256d7a868bbc1408efb998 /DTCallback.c | |
| parent | 4d0ef730585b2791a3916a47887051f07e528b75 (diff) | |
| download | System.c4g-1f39a1cc3caa318807586d74a8f8b34adbdb1371.tar.gz System.c4g-1f39a1cc3caa318807586d74a8f8b34adbdb1371.zip | |
DTCallback: Enable fast callbacks also if refs == [] (needed to enable fast callbacks inside BindCallback)
Diffstat (limited to 'DTCallback.c')
| -rw-r--r-- | DTCallback.c | 4 |
1 files 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) { |
