From 6a0ca8590f406cdf5629a2b26c29367333ee4916 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 26 Mar 2015 02:26:09 +0100 Subject: [PATCH] speed up some debug functions by 99.99% --- addons/common/functions/fnc_logControls.sqf | 13 +------------ addons/common/functions/fnc_logDisplays.sqf | 13 +------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/addons/common/functions/fnc_logControls.sqf b/addons/common/functions/fnc_logControls.sqf index 5a0a17c317..5bcaea779b 100644 --- a/addons/common/functions/fnc_logControls.sqf +++ b/addons/common/functions/fnc_logControls.sqf @@ -1,15 +1,4 @@ // by commy2 #include "script_component.hpp" -private ["_array", "_index"]; - -_array = []; - -for "_index" from 0 to 10000 do { - if (str (findDisplay _this displayCtrl _index) != "No control") then { - diag_log text str (findDisplay _this displayCtrl _index); - _array pushBack _index; - }; -}; - -_array; +[allControls findDisplay _this, {ctrlIDC _this}] call FUNC(map) diff --git a/addons/common/functions/fnc_logDisplays.sqf b/addons/common/functions/fnc_logDisplays.sqf index 81598facf4..0ab4fbe5bc 100644 --- a/addons/common/functions/fnc_logDisplays.sqf +++ b/addons/common/functions/fnc_logDisplays.sqf @@ -1,15 +1,4 @@ // by commy2 #include "script_component.hpp" -private ["_array", "_index"]; - -_array = []; - -for "_index" from 0 to 10000 do { - if (str (findDisplay _index) != "No Display") then { - diag_log text str findDisplay _index; - _array pushBack _index; - }; -}; - -_array; +[allDisplays, {ctrlIDD _this}] call FUNC(map)