]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/timeq.c
LOC fix for non-ldap LOC where ldap is available
[irc/evilnet/x3.git] / src / timeq.c
index 064d2d76e04d04417dd6154f3149072243f1b4cc..c00b16518f73919cd21e81a032dd02d866825929 100644 (file)
@@ -35,10 +35,9 @@ timeq_cleanup(void)
 {
     timeq_del(0, 0, 0, TIMEQ_IGNORE_WHEN|TIMEQ_IGNORE_FUNC|TIMEQ_IGNORE_DATA);
     heap_delete(timeq);
-    timeq = NULL;
 }
 
-static void
+void
 timeq_init(void)
 {
     timeq = heap_new(int_comparator);
@@ -49,8 +48,6 @@ time_t
 timeq_next(void)
 {
     void *time;
-    if (!timeq)
-        return ~0;
     heap_peek(timeq, &time, 0);
     return (time_t)time;
 }
@@ -65,8 +62,6 @@ timeq_add_real(time_t when, timeq_func func, void *data, UNUSED_ARG(const char *
     ent->func = func;
     ent->data = data;
     w = (void*)when;
-    if (!timeq)
-        timeq_init();
     heap_insert(timeq, w, ent);
 }
 
@@ -102,7 +97,6 @@ timeq_del_real(time_t when, timeq_func func, void *data, int mask, UNUSED_ARG(co
     extra.func = func;
     extra.data = data;
     extra.mask = mask;
-    if (timeq)
     heap_remove_pred(timeq, timeq_del_matching, &extra);
 }