mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
Call only once per button per profile .read_button
ratbag_profile_init_buttons() already loops over the given number of buttons. Remove the extra for loop and save some CPU (and possibly USB depending on the driver) cycles. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -570,8 +570,7 @@ ratbag_create_profile(struct ratbag_device *device,
|
||||
assert(device->driver->read_profile);
|
||||
device->driver->read_profile(profile, index);
|
||||
|
||||
for (i = 0; i < num_buttons; i++)
|
||||
ratbag_profile_init_buttons(profile, i);
|
||||
ratbag_profile_init_buttons(profile, num_buttons);
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user