summaryrefslogtreecommitdiff
path: root/plugins/YAPP/src/services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-09 19:32:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-09 19:32:39 +0300
commitdf6b0c988eb26339d4c7e4a1d0fe3b9717703c28 (patch)
tree5b4960edd6c9186e1fbc14f83f7f08a6a842f0a7 /plugins/YAPP/src/services.cpp
parent303dd9297732fc943ed3e20ab37587f0c009dfe5 (diff)
more loop-related code cleaning
Diffstat (limited to 'plugins/YAPP/src/services.cpp')
-rw-r--r--plugins/YAPP/src/services.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp
index 87ef273df9..d9143ab624 100644
--- a/plugins/YAPP/src/services.cpp
+++ b/plugins/YAPP/src/services.cpp
@@ -323,7 +323,7 @@ INT_PTR Popup_ShowHistory(WPARAM, LPARAM)
return 0;
}
-LIST<POPUPCLASS> arClasses(3);
+LIST<POPUPCLASS> arClasses(3, PtrKeySortT);
static INT_PTR RegisterPopupClass(WPARAM, LPARAM lParam)
{
@@ -361,15 +361,12 @@ static INT_PTR UnregisterPopupClass(WPARAM, LPARAM lParam)
POPUPCLASS *pc = (POPUPCLASS*)lParam;
if (pc == nullptr)
return 1;
+ if (arClasses.find(pc) == nullptr)
+ return 1;
- for (int i=0; i < arClasses.getCount(); i++)
- if (arClasses[i] == pc) {
- arClasses.remove(i);
- FreePopupClass(pc);
- return 0;
- }
-
- return 1;
+ arClasses.remove(pc);
+ FreePopupClass(pc);
+ return 0;
}
static INT_PTR CreateClassPopup(WPARAM wParam, LPARAM lParam)