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
/NLogPublic

Commite37aabb

Browse files
authored
JsonAttribute - Reduce code complexity when Encode = false (#6053)
1 parent0ba4099 commite37aabb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

‎src/NLog/Layouts/JSON/JsonAttribute.cs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ internal bool RenderAppendJsonValue(LogEventInfo logEvent, IJsonConverter jsonCo
165165
if(!Encode)
166166
{
167167
varvalueStart=builder.Length;
168-
if(!RenderAppendJsonValue(logEvent,builder,valueStart))
169-
returnfalse;
168+
returnRenderAppendJsonValue(logEvent,builder,valueStart);
170169
}
171-
elseif(ValueTypeisnull)
170+
171+
if(ValueTypeisnull)
172172
{
173173
builder.Append('"');
174174

@@ -178,7 +178,7 @@ internal bool RenderAppendJsonValue(LogEventInfo logEvent, IJsonConverter jsonCo
178178

179179
Targets.DefaultJsonSerializer.PerformJsonEscapeWhenNeeded(builder,valueStart,EscapeUnicode);
180180
builder.Append('"');
181-
}
181+
}
182182
else
183183
{
184184
varobjectValue=_layoutInfo.RenderValue(logEvent);
@@ -187,7 +187,6 @@ internal bool RenderAppendJsonValue(LogEventInfo logEvent, IJsonConverter jsonCo
187187

188188
jsonConverter.SerializeObject(objectValue,builder);
189189
}
190-
191190
returntrue;
192191
}
193192

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp