diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:39:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:39:55 +0400 |
commit | fea5af0d88c7d97862ab428922b13231f88692b6 (patch) | |
tree | 3cb13f9a58a050d8fb2c27cf1ae9b0790d395c61 /source/blender | |
parent | 40c2f52dbf782d18a4819eb583ea3b297b6dfb77 (diff) |
code cleanup: replace wm_macro_modal inline search for BLI_findptr.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 981467cbba6..ddc48ce6332 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -307,14 +307,9 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event) /* if new operator is modal and also added its own handler */ if (retval & OPERATOR_RUNNING_MODAL && op->opm != opm) { wmWindow *win = CTX_wm_window(C); - wmEventHandler *handler = NULL; - - for (handler = win->modalhandlers.first; handler; handler = handler->next) { - /* first handler in list is the new one */ - if (handler->op == op) - break; - } + wmEventHandler *handler; + handler = BLI_findptr(&win->modalhandlers, op, offsetof(wmEventHandler, op)); if (handler) { BLI_remlink(&win->modalhandlers, handler); wm_event_free_handler(handler); |