Skip to content

Commit

Permalink
Merge pull request #28 from simatic-ax/performance-optimization-in-se…
Browse files Browse the repository at this point in the history
…rialize

fix: Performance optimization in serialize
  • Loading branch information
sjuergen authored Sep 8, 2022
2 parents f944245 + c11a096 commit 91426df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Document/JsonDocument.st
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ NAMESPACE Simatic.Ax.Json
AddString := TRUE;
END_METHOD

/// Returns the count of the serialized cahracters
/// Returns the count of the serialized characters
METHOD PUBLIC GetLength : DINT
GetLength := _lentgh;
END_METHOD
Expand Down Expand Up @@ -161,7 +161,7 @@ NAMESPACE Simatic.Ax.Json
_currentElement := _nextElement;
END_WHILE;

// Clear the buffer
/// Clear the buffer
THIS.ClearBuffer(hard := TRUE);
_firstElement := NULL;
_lastElement := NULL;
Expand Down
4 changes: 1 addition & 3 deletions src/Elements/AbstractJsonElement.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ NAMESPACE Simatic.Ax.Json
VAR_TEMP
_i : DINT;
END_VAR
FOR _i := 1 TO LengthOf(valueAsString) DO
doc^.AddChar(valueAsString[_i]);
END_FOR;
doc^.AddString(valueAsString);
END_METHOD

METHOD PUBLIC HasNext : BOOL
Expand Down

0 comments on commit 91426df

Please sign in to comment.