From 85b734fde8e14e0b2f22b090551776bfcaa6d0b7 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Tue, 9 Apr 2019 16:39:16 +0200 Subject: [PATCH] clutter/device-manager: Small code cleanup Use a `memcmp()` instead of checking every field in the structure to be equal, it's both faster and less error prone. https://gitlab.gnome.org/GNOME/mutter/merge_requests/531 --- clutter/clutter/clutter-device-manager.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/clutter/clutter/clutter-device-manager.c b/clutter/clutter/clutter-device-manager.c index 1800d01c4..c67638422 100644 --- a/clutter/clutter/clutter-device-manager.c +++ b/clutter/clutter/clutter-device-manager.c @@ -550,13 +550,7 @@ static gboolean are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a, ClutterKbdA11ySettings *b) { - return (a->controls == b->controls && - a->slowkeys_delay == b->slowkeys_delay && - a->debounce_delay == b->debounce_delay && - a->timeout_delay == b->timeout_delay && - a->mousekeys_init_delay == b->mousekeys_init_delay && - a->mousekeys_max_speed == b->mousekeys_max_speed && - a->mousekeys_accel_time == b->mousekeys_accel_time); + return (memcmp (a, b, sizeof (ClutterKbdA11ySettings)) == 0); } void