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

Commit373e08a

Browse files
committed
Remove redundant test.
The condition "context_start < context_end" is strictly weakerthan "context_end - context_start >= 50", so we don't need both.Oversight in commitffd3944, noted by tanghy.fnst.In passing, line-wrap a nearby test to make it more readable.Discussion:https://postgr.es/m/OS0PR01MB61137C4054774F44E3A9DC89FBC69@OS0PR01MB6113.jpnprd01.prod.outlook.com
1 parenta780b2f commit373e08a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/utils/adt/jsonfuncs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ report_json_context(JsonLexContext *lex)
652652
context_end=lex->token_terminator;
653653

654654
/* Advance until we are close enough to context_end */
655-
while (context_end-context_start >=50&&context_start<context_end)
655+
while (context_end-context_start >=50)
656656
{
657657
/* Advance to next multibyte character */
658658
if (IS_HIGHBIT_SET(*context_start))
@@ -680,7 +680,9 @@ report_json_context(JsonLexContext *lex)
680680
* suffixing "..." if not ending at end of line.
681681
*/
682682
prefix= (context_start>line_start) ?"..." :"";
683-
suffix= (lex->token_type!=JSON_TOKEN_END&&context_end-lex->input<lex->input_length&&*context_end!='\n'&&*context_end!='\r') ?"..." :"";
683+
suffix= (lex->token_type!=JSON_TOKEN_END&&
684+
context_end-lex->input<lex->input_length&&
685+
*context_end!='\n'&&*context_end!='\r') ?"..." :"";
684686

685687
returnerrcontext("JSON data, line %d: %s%s%s",
686688
lex->line_number,prefix,ctxt,suffix);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp