From 97887ae1f32e496483f3c6ac38b8da2faa39d04f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Apr 2018 17:12:48 +0300 Subject: code cleaning --- src/mir_app/src/menu_clist.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index e4e6b06464..983b3ccbc8 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -45,7 +45,6 @@ void InitTrayMenus(void); int hMainMenuObject = 0, hContactMenuObject = 0, hStatusMenuObject = 0; int currentStatusMenuItem; -int statustopos(int status); void Proto_SetStatus(const char *szProto, unsigned status); OBJLIST g_menuProtos(1); @@ -70,6 +69,15 @@ MStatus g_statuses[MAX_STATUS_COUNT] = { ID_STATUS_OUTTOLUNCH, SKINICON_STATUS_OUTTOLUNCH, PF2_OUTTOLUNCH }, }; +static int statustopos(int status) +{ + for (auto &it : g_statuses) + if (status == it.iStatus) + return int(&it - g_statuses); + + return -1; +} + ///////////////////////////////////////////////////////////////////////////////////////// // service functions @@ -899,15 +907,6 @@ static int sttRebuildHotkeys(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// -int statustopos(int status) -{ - for (int j = 0; j < _countof(g_statuses); j++) - if (status == g_statuses[j].iStatus) - return j; - - return -1; -} - static int MenuProtoAck(WPARAM, LPARAM lParam) { ACKDATA *ack = (ACKDATA*)lParam; -- cgit v1.2.3