diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-09-10 08:43:00 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-09-11 07:19:57 -0700 |
commit | 643085f992797c21717c08808ad99b5e34d1ef02 (patch) | |
tree | e5c749d45d9c2f033d6a004c1822ad9e97311411 /core | |
parent | 9576a9ba8a73356fbbf1dcd6f19e442668205e98 (diff) | |
download | subsurface-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.c | 5 |
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"); } |