X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=dive.c;h=b7f61293636bba44b0d0c49cf344615ba22ef03f;hb=1937df188a2928478a9012a382ba1360d5e309b7;hp=32ea2ffe19a72f240df0638eafb1a9be3770a7d8;hpb=aa416e3c96dfa53db5ae277e72f6a03821c45cac;p=ext%2Fsubsurface.git diff --git a/dive.c b/dive.c index 32ea2ff..b7f6129 100644 --- a/dive.c +++ b/dive.c @@ -117,7 +117,6 @@ struct dive *fixup_dive(struct dive *dive) int maxdepth = 0, mintemp = 0; int lastdepth = 0; int lasttemp = 0; - temperature_t *redundant_temp = NULL; for (i = 0; i < dive->samples; i++) { struct sample *sample = dive->sample + i; @@ -141,17 +140,12 @@ struct dive *fixup_dive(struct dive *dive) /* * If we have consecutive identical * temperature readings, throw away - * the redundant ones. We care about - * the "edges" only. + * the redundant ones. */ - if (lasttemp == temp) { - if (redundant_temp) - redundant_temp->mkelvin = 0; - redundant_temp = &sample->temperature; - } else { - redundant_temp = NULL; + if (lasttemp == temp) + sample->temperature.mkelvin = 0; + else lasttemp = temp; - } if (!mintemp || temp < mintemp) mintemp = temp;