diff options
author | George Hazan <george.hazan@gmail.com> | 2025-06-06 13:50:54 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-06-06 13:50:54 +0300 |
commit | f9a0656a9d9460360eca74d2f335b73ce7411f6f (patch) | |
tree | 9b9bd62e6208552a61a507f498182d815a77c1e9 /libs/libjson/src | |
parent | e4ab7cd45a4c45e81b8b862be68951da22334dd9 (diff) |
unused crutch removed
Diffstat (limited to 'libs/libjson/src')
-rw-r--r-- | libs/libjson/src/stdafx.cxx | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/libs/libjson/src/stdafx.cxx b/libs/libjson/src/stdafx.cxx index c19c494c38..eac064fe7b 100644 --- a/libs/libjson/src/stdafx.cxx +++ b/libs/libjson/src/stdafx.cxx @@ -18,35 +18,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-static void eraseOldValue(JSONNode &json, const char *pszName)
-{
- if (pszName && *pszName != 0) {
- auto n = json.find(pszName);
- if (n != json.end())
- json.erase(n);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT_PARAM ¶m)
{
- eraseOldValue(json, param.szName);
json.push_back(JSONNode(param.szName, param.iValue));
return json;
}
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT64_PARAM ¶m)
{
- eraseOldValue(json, param.szName);
json.push_back(JSONNode(param.szName, param.iValue));
return json;
}
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const SINT64_PARAM ¶m)
{
- eraseOldValue(json, param.szName);
-
char str[40];
_i64toa(param.iValue, str, 10);
return json << CHAR_PARAM(param.szName, str);
@@ -54,15 +39,12 @@ LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const SINT64_PARAM ¶m) LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const BOOL_PARAM ¶m)
{
- eraseOldValue(json, param.szName);
json.push_back(JSONNode(param.szName, param.bValue));
return json;
}
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const CHAR_PARAM ¶m)
{
- eraseOldValue(json, param.szName);
-
if (param.szValue == nullptr) {
JSONNode tmp(JSON_NULL); tmp.set_name(param.szName);
json.push_back(tmp);
@@ -78,15 +60,12 @@ LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const CHAR_PARAM ¶m) LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const WCHAR_PARAM ¶m)
{
- eraseOldValue(json, param.szName);
json.push_back(JSONNode(param.szName, ptrA(mir_utf8encodeW(param.wszValue)).get()));
return json;
}
LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const NULL_PARAM ¶m)
{
- eraseOldValue(json, param.szName);
-
JSONNode newOne(JSON_NULL);
newOne.set_name(param.szName);
json.push_back(newOne);
@@ -95,8 +74,6 @@ LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const NULL_PARAM ¶m) LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const JSON_PARAM ¶m)
{
- eraseOldValue(json, param.szName);
-
JSONNode newOne(param.node);
newOne.set_name(param.szName);
json.push_back(newOne);
|