Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ce433e

Browse files
committed
Fix unnecessary trailing whitespace in JSONPretty format
1 parent1959486 commit0ce433e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎src/DataTypes/Serializations/SerializationTuple.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,9 @@ void SerializationTuple::serializeTextJSONPretty(const IColumn & column, size_t
308308
}
309309

310310
writeChar('\n', ostr);
311-
writeChar(settings.json.pretty_print_indent, indent * settings.json.pretty_print_indent_multiplier, ostr);
311+
constauto final_indent = indent * settings.json.pretty_print_indent_multiplier;
312+
if (final_indent >1)
313+
writeChar(settings.json.pretty_print_indent, final_indent, ostr);
312314
writeChar('}', ostr);
313315
}
314316
else

‎tests/queries/0_stateless/03727_named_tuples_pretty_format.reference‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
│ │ │ │↳ ], ↴│
2222
│ │ │ │↳ "optional_field": null, ↴│
2323
│ │ │ │↳ "extra_id": 999 ↴│
24-
│ │ │ │↳ }
24+
│ │ │ │↳}
2525
├─────────┼──────────┼─────────┼──────────────────────────────────┤
2626
2. │ 2 │ Hello │ ᴺᵁᴸᴸ │ { ↴│
2727
│ │ │ │↳ "id": 7, ↴│
@@ -43,5 +43,5 @@
4343
│ │ │ │↳ ], ↴│
4444
│ │ │ │↳ "optional_field": "Some text",↴│
4545
│ │ │ │↳ "extra_id": 555 ↴│
46-
│ │ │ │↳ }
46+
│ │ │ │↳}
4747
└─────────┴──────────┴─────────┴──────────────────────────────────┘

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp