From 79e4ee10e9ebd6382f819502285685ce21e69ef0 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 6 Jul 2016 18:44:56 +0000 Subject: dbx_lmdb: code optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@17069 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbsettings.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'plugins/Dbx_mdb/src/dbsettings.cpp') diff --git a/plugins/Dbx_mdb/src/dbsettings.cpp b/plugins/Dbx_mdb/src/dbsettings.cpp index 95faa27a68..9c48880618 100644 --- a/plugins/Dbx_mdb/src/dbsettings.cpp +++ b/plugins/Dbx_mdb/src/dbsettings.cpp @@ -345,7 +345,6 @@ STDMETHODIMP_(BOOL) CDbxMdb::SetSettingResident(BOOL bIsResident, const char *ps char *szSetting = m_cache->GetCachedSetting(NULL, pszSettingName, 0, (int)strlen(pszSettingName)); szSetting[-1] = (char)bIsResident; - mir_cslock lck(m_csDbAccess); int idx = m_lResidentSettings.getIndex(szSetting); if (idx == -1) { if (bIsResident) @@ -372,13 +371,11 @@ STDMETHODIMP_(BOOL) CDbxMdb::WriteContactSetting(MCONTACT contactID, DBCONTACTWR { if (dbcwNotif.value.pszVal != NULL) { - char* val = mir_utf8encodeW(dbcwNotif.value.pwszVal); + T2Utf val(dbcwNotif.value.pwszVal); if (val == NULL) return 1; - dbcwNotif.value.pszVal = (char*)alloca(strlen(val) + 1); - strcpy(dbcwNotif.value.pszVal, val); - mir_free(val); + dbcwNotif.value.pszVal = NEWSTR_ALLOCA(val); dbcwNotif.value.type = DBVT_UTF8; } else return 1; -- cgit v1.2.3