[gtk/wip/baedert/for-master] shortcutcontroller: Separate trigger/action early returns
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master] shortcutcontroller: Separate trigger/action early returns
- Date: Thu, 19 Nov 2020 15:52:44 +0000 (UTC)
commit ad4b24521b746778e7901f53f19d67edd54f2d20
Author: Timm Bäder <mail baedert org>
Date: Thu Nov 19 16:27:48 2020 +0100
shortcutcontroller: Separate trigger/action early returns
We take this early return in update_accel over 36k times when starting
the widget factory and always because the action is not a named action.
gtk/gtkshortcutcontroller.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkshortcutcontroller.c b/gtk/gtkshortcutcontroller.c
index 0c7922f5ec..72f777d386 100644
--- a/gtk/gtkshortcutcontroller.c
+++ b/gtk/gtkshortcutcontroller.c
@@ -461,11 +461,12 @@ update_accel (GtkShortcut *shortcut,
if (!muxer)
return;
- trigger = gtk_shortcut_get_trigger (shortcut);
action = gtk_shortcut_get_action (shortcut);
+ if (!GTK_IS_NAMED_ACTION (action))
+ return;
- if (!GTK_IS_NAMED_ACTION (action) ||
- !GTK_IS_KEYVAL_TRIGGER (trigger))
+ trigger = gtk_shortcut_get_trigger (shortcut);
+ if (!GTK_IS_KEYVAL_TRIGGER (trigger))
return;
target = gtk_shortcut_get_arguments (shortcut);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]