Skip to content

Commit

Permalink
Remove the hidden JSON_NO_EXTRA_WHITESPACE compile knob.
Browse files Browse the repository at this point in the history
Unsetting it can lead to seg-faults. I don't think it's worth having to fix and
then test this undocumented permutation.
  • Loading branch information
bwoodsend committed Feb 12, 2022
1 parent 080744d commit f0e3aec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
3 changes: 0 additions & 3 deletions lib/ultrajson.h
Expand Up @@ -56,9 +56,6 @@ tree doesn't have cyclic references.
#include <stdio.h>
#include <wchar.h>

// Don't output any extra whitespaces when encoding
#define JSON_NO_EXTRA_WHITESPACE

// Max decimals to encode double floating point numbers with
#ifndef JSON_DOUBLE_MAX_DECIMALS
#define JSON_DOUBLE_MAX_DECIMALS 15
Expand Down
10 changes: 0 additions & 10 deletions lib/ultrajsonenc.c
Expand Up @@ -679,14 +679,10 @@ static void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t c
Buffer_AppendCharUnchecked(enc, '\"');

Buffer_AppendCharUnchecked (enc, ':');
#ifdef JSON_NO_EXTRA_WHITESPACE
if (enc->indent)
{
Buffer_AppendCharUnchecked (enc, ' ');
}
#else
Buffer_AppendCharUnchecked (enc, ' ');
#endif
}

tc.encoder_prv = enc->prv;
Expand All @@ -710,9 +706,6 @@ static void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t c
if (count > 0)
{
Buffer_AppendCharUnchecked (enc, ',');
#ifndef JSON_NO_EXTRA_WHITESPACE
Buffer_AppendCharUnchecked (enc, ' ');
#endif
}
Buffer_AppendIndentNewlineUnchecked (enc);

Expand Down Expand Up @@ -758,9 +751,6 @@ static void encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t c
if (count > 0)
{
Buffer_AppendCharUnchecked (enc, ',');
#ifndef JSON_NO_EXTRA_WHITESPACE
Buffer_AppendCharUnchecked (enc, ' ');
#endif
}
Buffer_AppendIndentNewlineUnchecked (enc);

Expand Down

0 comments on commit f0e3aec

Please sign in to comment.