From 0aaff9a07d3bdf8588cef15d502aeb4fdab22e5e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 18 Aug 2022 15:40:49 +1000 Subject: WM: optimize adding notifier duplication check Use a GSet to check for duplicate notifiers, for certain Python scripts checking for duplicate notifiers added considerable overhead. This is an alternative to D15129 with fewer chances to existing logic. --- source/blender/makesdna/DNA_windowmanager_types.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 116ea4821cb..2586e13da39 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -151,6 +151,11 @@ typedef struct wmWindowManager { /** Refresh/redraw #wmNotifier structs. */ ListBase notifier_queue; + /** + * For duplicate detection. + * \note keep in sync with `notifier_queue` adding/removing elements must also update this set. + */ + struct GSet *notifier_queue_set; /** Information and error reports. */ struct ReportList reports; -- cgit v1.2.3