Skip to content

Commit

Permalink
decrease progress updates frequency when searching for variables on W…
Browse files Browse the repository at this point in the history
…indows and macOS

it negatively impacts performance and bar shows full percents anyway
  • Loading branch information
Neverous committed Aug 19, 2023
1 parent 5e0691b commit a5ea943
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/efivar-lite.darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ int efi_get_next_variable_name(efi_guid_t **guid, char **name)
{
while(1)
{
if(efi_get_next_variable_name_progress_cb)
efi_get_next_variable_name_progress_cb(current_variable++, EFI_MAX_VARIABLES);
++current_variable;
if(efi_get_next_variable_name_progress_cb && current_variable % (EFI_MAX_VARIABLES / 100u) == 0u)
efi_get_next_variable_name_progress_cb(current_variable, EFI_MAX_VARIABLES);

int ret = _efi_get_next_variable_name(guid, name);
if(ret <= 0)
Expand Down
5 changes: 3 additions & 2 deletions src/efivar-lite.win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ int efi_get_next_variable_name(efi_guid_t **guid, TCHAR **name)
{
while(1)
{
if(efi_get_next_variable_name_progress_cb)
efi_get_next_variable_name_progress_cb(current_variable++, EFI_MAX_VARIABLES);
++current_variable;
if(efi_get_next_variable_name_progress_cb && current_variable % (EFI_MAX_VARIABLES / 100u) == 0u)
efi_get_next_variable_name_progress_cb(current_variable, EFI_MAX_VARIABLES);

int ret = _efi_get_next_variable_name(guid, name);
if(ret <= 0)
Expand Down

0 comments on commit a5ea943

Please sign in to comment.