[gnome-builder] egg-task-cache: cleanup logic a bit
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] egg-task-cache: cleanup logic a bit
- Date: Fri, 15 May 2015 01:02:03 +0000 (UTC)
commit 52245d9bc66d81dd30a5a04f2190dfe0275ba2c0
Author: Christian Hergert <christian hergert me>
Date: Thu May 14 17:59:53 2015 -0700
egg-task-cache: cleanup logic a bit
We require non-NULL, so its okay to check for that.
contrib/egg/egg-task-cache.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/contrib/egg/egg-task-cache.c b/contrib/egg/egg-task-cache.c
index 9a97d53..eb4317c 100644
--- a/contrib/egg/egg-task-cache.c
+++ b/contrib/egg/egg-task-cache.c
@@ -397,25 +397,25 @@ egg_task_cache_fetch_cb (GObject *object,
g_assert (EGG_IS_TASK_CACHE (self));
g_assert (G_IS_TASK (task));
+ g_hash_table_remove (self->in_flight, key);
+
ret = g_task_propagate_pointer (task, &error);
- if (error != NULL)
+ if (ret != NULL)
{
- egg_task_cache_propagate_error (self, key, error);
- g_clear_error (&error);
+ egg_task_cache_populate (self, key, ret);
+ egg_task_cache_propagate_pointer (self, key, ret);
+ self->value_destroy_func (ret);
}
else
{
- egg_task_cache_populate (self, key, ret);
- egg_task_cache_propagate_pointer (self, key, ret);
+ egg_task_cache_propagate_error (self, key, error);
+ g_clear_error (&error);
}
- g_hash_table_remove (self->in_flight, key);
- EGG_COUNTER_DEC (in_flight);
-
self->key_destroy_func (key);
- if (ret != NULL)
- self->value_destroy_func (ret);
+
+ EGG_COUNTER_DEC (in_flight);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]