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 <micha@michaelwerle.com>
This commit is contained in:
Micha WERLE 2023-11-20 09:23:20 +09:00 committed by Michael Keller
parent c7171179b3
commit d0b95f9401

View file

@ -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 };