From 15ef53fb805a96fec1dd9358ce58bcef6de9baab Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 10 Sep 2017 08:43:54 +0300 Subject: Do not save heartbeat to XML if it has not changed Signed-off-by: Miika Turkia --- core/save-xml.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/save-xml.c b/core/save-xml.c index 7a12244f6..f7564f4b1 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -282,7 +282,10 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl put_milli(b, " po2='", sample->setpoint.mbar, " bar'"); old->setpoint = sample->setpoint; } - show_index(b, sample->heartbeat, "heartbeat='", "'"); + if (sample->heartbeat != old->heartbeat) { + show_index(b, sample->heartbeat, "heartbeat='", "'"); + old->heartbeat = sample->heartbeat; + } if (sample->bearing.degrees != old->bearing.degrees) { show_index(b, sample->bearing.degrees, "bearing='", "'"); old->bearing.degrees = sample->bearing.degrees; -- cgit v1.2.3-70-g09d2