From d0b95f9401475280a51594296f5739a4cd94c2e6 Mon Sep 17 00:00:00 2001 From: Micha WERLE Date: Mon, 20 Nov 2023 09:23:20 +0900 Subject: [PATCH] refactor: revert questionable optimisation Reverted "optimisation" based on code feedback. Firstly, it's implementation-defined whether or not a stack frame is created for sub-scopes, secondly any optimisation is questionable regardless, and thirdly it was felt that it makes the code harder to understand. Signed-off-by: Micha WERLE --- core/libdivecomputer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index 57b1f0da5..abe7da6d8 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -117,11 +117,11 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t } } bool no_volume = true; - cylinder_t cyl = empty_cylinder; struct gasmix last_mix = gasmix_air; /* default to air */ clear_cylinder_table(&dive->cylinders); for (i = 0; i < MAX(ngases, ntanks); i++) { + cylinder_t cyl = empty_cylinder; cyl = empty_cylinder; if (i < ngases) { dc_gasmix_t gasmix = { 0 };