summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-09-10 08:43:00 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-09-11 07:19:57 -0700
commit643085f992797c21717c08808ad99b5e34d1ef02 (patch)
treee5c749d45d9c2f033d6a004c1822ad9e97311411 /core
parent9576a9ba8a73356fbbf1dcd6f19e442668205e98 (diff)
downloadsubsurface-643085f992797c21717c08808ad99b5e34d1ef02.tar.gz
Do not save bearing to XML if it has not changed
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/save-xml.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/save-xml.c b/core/save-xml.c
index 19b4e79b7..7a12244f6 100644
--- a/core/save-xml.c
+++ b/core/save-xml.c
@@ -283,7 +283,10 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl
old->setpoint = sample->setpoint;
}
show_index(b, sample->heartbeat, "heartbeat='", "'");
- show_index(b, sample->bearing.degrees, "bearing='", "'");
+ if (sample->bearing.degrees != old->bearing.degrees) {
+ show_index(b, sample->bearing.degrees, "bearing='", "'");
+ old->bearing.degrees = sample->bearing.degrees;
+ }
put_format(b, " />\n");
}