diff options
author | George Hazan <ghazan@miranda.im> | 2019-08-13 11:39:01 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-08-13 11:39:01 +0300 |
commit | 985c61c624c7304783266c9f79e602f26f2887fd (patch) | |
tree | d564daacf70417f2756137b6b86a3ee33025090e /protocols/CurrencyRates | |
parent | 23f1148da6fd87d759b69d6f3865384672f78974 (diff) |
useless checks removed
Diffstat (limited to 'protocols/CurrencyRates')
-rw-r--r-- | protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp index c35877dc4c..3c8bdbfed6 100644 --- a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp +++ b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp @@ -609,22 +609,15 @@ void CCurrencyRatesProviderBase::WriteContactRate(MCONTACT hContact, double dRat MCONTACT CCurrencyRatesProviderBase::CreateNewContact(const tstring& rsName) { MCONTACT hContact = db_add_contact(); - if (hContact) { - if (0 == Proto_AddToContact(hContact, CURRENCYRATES_PROTOCOL_NAME)) { - tstring sProvName = GetInfo().m_sName; - db_set_ws(hContact, CURRENCYRATES_MODULE_NAME, DB_STR_CURRENCYRATE_PROVIDER, sProvName.c_str()); - db_set_ws(hContact, CURRENCYRATES_MODULE_NAME, DB_STR_CURRENCYRATE_SYMBOL, rsName.c_str()); - db_set_ws(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, rsName.c_str()); - - mir_cslock lck(m_cs); - m_aContacts.push_back(hContact); - } - else { - db_delete_contact(hContact); - hContact = NULL; - } - } + Proto_AddToContact(hContact, CURRENCYRATES_PROTOCOL_NAME); + tstring sProvName = GetInfo().m_sName; + db_set_ws(hContact, CURRENCYRATES_MODULE_NAME, DB_STR_CURRENCYRATE_PROVIDER, sProvName.c_str()); + db_set_ws(hContact, CURRENCYRATES_MODULE_NAME, DB_STR_CURRENCYRATE_SYMBOL, rsName.c_str()); + db_set_ws(hContact, LIST_MODULE_NAME, CONTACT_LIST_NAME, rsName.c_str()); + + mir_cslock lck(m_cs); + m_aContacts.push_back(hContact); return hContact; } |