performance tweaks
[lttv.git] / ltt / branches / poly / lttv / lttv / tracecontext.c
index e0ddd00616f8ebc88931e68210f25bfad718c075..3af6045ca5606c3bc5665df205180624108430c5 100644 (file)
@@ -359,9 +359,8 @@ void lttv_tracefile_context_add_hooks(LttvTracefileContext *self,
   lttv_hooks_add_list(self->event, event);
   if(event_by_id != NULL)
     for(i = 0; i < lttv_hooks_by_id_max_id(event_by_id); i++) {
-      hook = lttv_hooks_by_id_get(self->event_by_id, i);
-      if(hook != NULL)
-        lttv_hooks_remove_list(hook, lttv_hooks_by_id_get(event_by_id, i));
+      hook = lttv_hooks_by_id_find(self->event_by_id, i);
+      lttv_hooks_add_list(hook, lttv_hooks_by_id_get(event_by_id, i));
     }
 
 }
@@ -379,8 +378,9 @@ void lttv_tracefile_context_remove_hooks(LttvTracefileContext *self,
   lttv_hooks_remove_list(self->event, event);
   if(event_by_id != NULL)
     for(i = 0; i < lttv_hooks_by_id_max_id(event_by_id); i++) {
-      hook = lttv_hooks_by_id_find(self->event_by_id, i);
-      lttv_hooks_add_list(hook, lttv_hooks_by_id_get(event_by_id, i));
+      hook = lttv_hooks_by_id_get(self->event_by_id, i);
+      if(hook != NULL)
+        lttv_hooks_remove_list(hook, lttv_hooks_by_id_get(event_by_id, i));
     }
 
   lttv_hooks_call(after_tracefile, self);
@@ -577,7 +577,7 @@ lttv_tracefile_context_get_type(void)
 
 
 
-gboolean get_first(gpointer key, gpointer value, gpointer user_data) {
+static gboolean get_first(gpointer key, gpointer value, gpointer user_data) {
   *((LttvTracefileContext **)user_data) = (LttvTracefileContext *)value;
   return TRUE;
 }
This page took 0.024268 seconds and 4 git commands to generate.