core: Optimize check for pending events
authorChris Dickens <christopher.a.dickens@gmail.com>
Thu, 13 Aug 2020 05:34:03 +0000 (22:34 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Thu, 13 Aug 2020 05:34:03 +0000 (22:34 -0700)
commit7b5e31b8cb427cd95a307c607741cc52a39cb951
treee0b57deb1d8d527a1dfa705000d8a9a1121e208c
parentb40a26f9012c3b4fb29b589b97c37e9a32a06a5d
core: Optimize check for pending events

Prior to this commit, a check for whether any events are pending
involved checking four different variables within the context. Optimize
this by using multiple bits within a single unsigned integer to
represent all the possible events that could be pending. This reduces
the check for whether any events are pending to a single load.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/core.c
libusb/hotplug.c
libusb/io.c
libusb/libusbi.h
libusb/version_nano.h