From ddd0523bb41ba38a2f683845a9d187c9936ae800 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 2 Jan 2015 21:29:40 -0800 Subject: git save format: Don't save redunant temperature sample data The git sample loader will fill in temperature data from the previous entry anyway, so saving repeated temperatures is just wasteful. It turns out that commit 6cf3787a0ed1 ("Remove code that zeroes out duplicate oxygen sensor and temperature values") removed the explicit redundant temperature removal in the dive fixup, which had hidden this issue. Cc: willem ferguson Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- save-xml.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/save-xml.c b/save-xml.c index 7317446f7..29e09dc98 100644 --- a/save-xml.c +++ b/save-xml.c @@ -213,7 +213,10 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl { put_format(b, " time.seconds, 60)); put_milli(b, " depth='", sample->depth.mm, " m'"); - put_temperature(b, sample->temperature, " temp='", " C'"); + if (sample->temperature.mkelvin && sample->temperature.mkelvin != old->temperature.mkelvin) { + put_temperature(b, sample->temperature, " temp='", " C'"); + old->temperature = sample->temperature; + } put_pressure(b, sample->cylinderpressure, " pressure='", " bar'"); put_pressure(b, sample->o2cylinderpressure, " o2pressure='", " bar'"); -- cgit v1.2.3-70-g09d2