diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-01-02 21:29:40 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-02 22:39:17 -0800 |
commit | ddd0523bb41ba38a2f683845a9d187c9936ae800 (patch) | |
tree | e08066a38aa906b6b8dd6d45834a454448c28c99 /save-xml.c | |
parent | 3212bfdf99cfed7f0ee26ec9536ece76ca090b23 (diff) | |
download | subsurface-ddd0523bb41ba38a2f683845a9d187c9936ae800.tar.gz |
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 <willemferguson@zoology.up.ac.za>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
-rw-r--r-- | save-xml.c | 5 |
1 files changed, 4 insertions, 1 deletions
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, " <sample time='%u:%02u min'", FRACTION(sample->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'"); |