OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.9k stars 926 forks source link

Only call JsonEncoder.EscapeString from WriteSimpleField if necessary #2530

Closed mregen closed 4 months ago

mregen commented 4 months ago

Proposed changes

EscapeString is a function which parses every string for special characters, but often times it is already known that there are no escape characters to process. Improve WriteSimpleField to only call JsonEncoder.EscapeString if necessary.

Related Issues

Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply. You can also fill these out after creating the PR.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 92.14286% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 53.97%. Comparing base (0fd58b4) to head (13b8681).

Files Patch % Lines
Stack/Opc.Ua.Core/Types/Encoders/JsonEncoder.cs 92.14% 10 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2530 +/- ## ========================================== - Coverage 54.07% 53.97% -0.10% ========================================== Files 334 334 Lines 64430 64455 +25 Branches 13241 13251 +10 ========================================== - Hits 34840 34791 -49 - Misses 25841 25911 +70 - Partials 3749 3753 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.