Skip to content

Commit f26a188

Browse files
committed
Only add spaces if nothing else will be added
1 parent 23f714a commit f26a188

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/JSON/PP.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ sub allow_bigint {
450450
$self->_down_indent() if ($self->{PROPS}[P_INDENT]);
451451

452452
return '[]' unless @res;
453-
my $space = $self->{PROPS}[P_SPACE_AFTER] ? ' ' : '';
453+
my $space = $pre eq '' && $self->{PROPS}[P_SPACE_AFTER] ? ' ' : '';
454454
return '[' . $pre . join( ",$space$pre", @res ) . $post . ']';
455455
}
456456

0 commit comments

Comments
 (0)