From 8ffc77be71507825a8f7585bcabff8ccc370206a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 8 Dec 2018 20:12:16 +0300 Subject: db_get_sa / db_get_wsa to receive the default value, massive code simplification --- plugins/ClientChangeNotify/src/CString.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'plugins/ClientChangeNotify') diff --git a/plugins/ClientChangeNotify/src/CString.cpp b/plugins/ClientChangeNotify/src/CString.cpp index b0396d375e..ece8b81645 100644 --- a/plugins/ClientChangeNotify/src/CString.cpp +++ b/plugins/ClientChangeNotify/src/CString.cpp @@ -259,14 +259,12 @@ template class TString; CString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const char *szDefaultValue) { - ptrA p(db_get_sa(hContact, szModule, szSetting)); - return CString(p == NULL ? szDefaultValue : p); + return CString(ptrA(db_get_sa(hContact, szModule, szSetting, szDefaultValue))); } TCString db_get_s(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue) { - ptrW p(db_get_wsa(hContact, szModule, szSetting)); - return TCString(p == NULL ? szDefaultValue : p); + return TCString(ptrW(db_get_wsa(hContact, szModule, szSetting, szDefaultValue))); } TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, const char *szSetting, const wchar_t *szDefaultValue) -- cgit v1.2.3