Browse Source

Improved SerializableJSONInteger class

- improved marshal() method by replacing char array
 approach with std::string approach
Patrick 4 years ago
parent
commit
faf8cc99a6
1 changed files with 2 additions and 5 deletions
  1. 2 5
      source/serialization/boxing/SerializableJSONInteger.cpp

+ 2 - 5
source/serialization/boxing/SerializableJSONInteger.cpp

@@ -3,7 +3,7 @@
  * Company:         Lynar Studios
  * Company:         Lynar Studios
  * E-Mail:          webmaster@lynarstudios.com
  * E-Mail:          webmaster@lynarstudios.com
  * Created:         2020-08-21
  * Created:         2020-08-21
- * Changed:         2020-08-23
+ * Changed:         2020-08-25
  *
  *
  * */
  * */
 
 
@@ -16,10 +16,7 @@ integer(std::move(_integer))
 ls_std::byte_field ls_std::SerializableJSONInteger::marshal()
 ls_std::byte_field ls_std::SerializableJSONInteger::marshal()
 {
 {
   this->_update();
   this->_update();
-  auto* data = new char[this->jsonObject.dump().size() + 1];
-  strcpy(data, this->jsonObject.dump().c_str());
-
-  return data;
+  return this->jsonObject.dump();
 }
 }
 
 
 void ls_std::SerializableJSONInteger::unmarshal(const ls_std::byte_field& _data)
 void ls_std::SerializableJSONInteger::unmarshal(const ls_std::byte_field& _data)