From c666399e170f60c7f4f210456125643ee36488ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Seidel?= Date: Thu, 8 Sep 2022 10:23:38 +0200 Subject: [PATCH 1/2] fix: optimize performance --- src/Elements/AbstractJsonElement.st | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Elements/AbstractJsonElement.st b/src/Elements/AbstractJsonElement.st index 8ba5f54..50c392e 100644 --- a/src/Elements/AbstractJsonElement.st +++ b/src/Elements/AbstractJsonElement.st @@ -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 From c11a09625ee434c8420bae97136b1996dbcca5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Seidel?= Date: Thu, 8 Sep 2022 10:23:47 +0200 Subject: [PATCH 2/2] fix: fix typo --- src/Document/JsonDocument.st | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Document/JsonDocument.st b/src/Document/JsonDocument.st index 9d4b329..7412cc6 100644 --- a/src/Document/JsonDocument.st +++ b/src/Document/JsonDocument.st @@ -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 @@ -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;