summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/database/dbutils.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp
index d6bb468c29..7dacd223cd 100644
--- a/src/modules/database/dbutils.cpp
+++ b/src/modules/database/dbutils.cpp
@@ -42,10 +42,10 @@ static INT_PTR DbEventTypeRegister(WPARAM, LPARAM lParam)
{
DBEVENTTYPEDESCR *et = (DBEVENTTYPEDESCR*)lParam;
if (et == NULL || et->cbSize != sizeof(DBEVENTTYPEDESCR))
- return 0;
+ return -1;
if (eventTypes.getIndex(et) != -1)
- return 0;
+ return -1;
DBEVENTTYPEDESCR *p = (DBEVENTTYPEDESCR*)mir_calloc(sizeof(DBEVENTTYPEDESCR));
p->cbSize = sizeof(DBEVENTTYPEDESCR);
@@ -78,12 +78,7 @@ static INT_PTR DbEventTypeGet(WPARAM wParam, LPARAM lParam)
DBEVENTTYPEDESCR tmp;
tmp.module = (char*)wParam;
tmp.eventType = lParam;
-
- int idx;
- if (!List_GetIndex((SortedList*)&eventTypes, &tmp, &idx))
- return 0;
-
- return (INT_PTR)eventTypes[idx];
+ return (INT_PTR)eventTypes.find(&tmp);
}
/////////////////////////////////////////////////////////////////////////////////////////