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
This commit is contained in:
Olivier Fourdan 2019-04-09 16:39:16 +02:00
parent 28419cdedf
commit 85b734fde8

View File

@ -550,13 +550,7 @@ static gboolean
are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a, are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a,
ClutterKbdA11ySettings *b) ClutterKbdA11ySettings *b)
{ {
return (a->controls == b->controls && return (memcmp (a, b, sizeof (ClutterKbdA11ySettings)) == 0);
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);
} }
void void