From 5554acb2c5e7c88197325a7b2f41aec0c0a33e2f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 1 May 2024 16:59:22 +0200 Subject: [PATCH] uemis: unglobalize next_table_index This is only initialized and used in one loop. Very mysterious why this should be a global variable. Signed-off-by: Berthold Stoeger --- core/uemis-downloader.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/uemis-downloader.cpp b/core/uemis-downloader.cpp index 1511ba4b6..ac2cef207 100644 --- a/core/uemis-downloader.cpp +++ b/core/uemis-downloader.cpp @@ -82,7 +82,6 @@ static int filenr; static int number_of_files; static int max_mem_used = -1; -static int next_table_index = 0; static int dive_to_read = 0; static uint32_t mindiveid; @@ -1476,8 +1475,7 @@ std::string do_uemis_import(device_data_t *data) /* Regardless on where we are with the memory situation, it's time now * to see if we have to clean some dead bodies from our download table */ - next_table_index = 0; - while (next_table_index < data->log->dives->nr) { + for (int next_table_index = 0; next_table_index < data->log->dives->nr; ) { if (data->log->dives->dives[next_table_index]->hidden_by_filter) uemis_delete_dive(data, data->log->dives->dives[next_table_index]->dc.diveid); else