From d22ed83105dc6342407ea29e0447ef6d3a1106ce Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 30 Sep 2015 17:38:07 +0000 Subject: code optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@15481 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ExternalAPI/m_statusplugins.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'plugins/ExternalAPI/m_statusplugins.h') diff --git a/plugins/ExternalAPI/m_statusplugins.h b/plugins/ExternalAPI/m_statusplugins.h index a242805c97..63e39e80b3 100644 --- a/plugins/ExternalAPI/m_statusplugins.h +++ b/plugins/ExternalAPI/m_statusplugins.h @@ -135,19 +135,12 @@ typedef struct { __inline static int announce_status_change(char *szProto, int newstatus, TCHAR *szMsg) { - PROTOCOLSETTINGEX ps; - - ZeroMemory(&ps, sizeof(PROTOCOLSETTINGEX)); + PROTOCOLSETTINGEX ps = { 0 }; ps.cbSize = sizeof(PROTOCOLSETTINGEX); - if (szProto != NULL) { - ps.lastStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0); - } else { - ps.lastStatus = CallService(MS_CLIST_GETSTATUSMODE, 0, 0); - } + ps.lastStatus = szProto != NULL ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0); ps.status = newstatus; ps.szMsg = szMsg; ps.szName = szProto; - return CallService(MS_KS_ANNOUNCESTATUSCHANGE, 0, (LPARAM)&ps); } -- cgit v1.2.3