From d39bafd9fb4cc0725786ab815bf7dd5fb03ef15e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 20 Jun 2015 13:43:28 +0200 Subject: [PATCH] Canonicalize output JSON, so that we do not waste bandwidth with empty diffs. --- remoteglot.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/remoteglot.pl b/remoteglot.pl index 9cc82e3..3c12569 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -774,7 +774,9 @@ sub output_json { } $json->{'refutation_lines'} = \%refutation_lines; - my $encoded = JSON::XS::encode_json($json); + my $json_enc = JSON::XS->new; + $json_enc->canonical(1); + my $encoded = $json_enc->encode($json); unless ($historic_json_only || !defined($remoteglotconf::json_output) || (defined($last_written_json) && $last_written_json eq $encoded)) { atomic_set_contents($remoteglotconf::json_output, $encoded); -- 2.39.2