From f9a0656a9d9460360eca74d2f335b73ce7411f6f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 6 Jun 2025 13:50:54 +0300 Subject: unused crutch removed --- libs/libjson/src/stdafx.cxx | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'libs/libjson/src') 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 . #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); -- cgit v1.2.3