[libgda] GdaSet: bug fixed
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaSet: bug fixed
- Date: Mon, 15 Dec 2014 21:26:56 +0000 (UTC)
commit 7de2b5c5420363072db389a2afd244b0118d5ede
Author: Vivien Malerba <malerba gnome-db org>
Date: Mon Dec 15 22:26:04 2014 +0100
GdaSet: bug fixed
libgda/gda-set.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/libgda/gda-set.c b/libgda/gda-set.c
index c43ebfd..01f2306 100644
--- a/libgda/gda-set.c
+++ b/libgda/gda-set.c
@@ -2186,32 +2186,29 @@ gda_set_get_group (GdaSet *set, GdaHolder *holder)
{
GdaSetNode *node;
GdaSetGroup *retval = NULL;
- GSList *list, *sublist;
- GdaHolder *node_holder;
+ GSList *list;
g_return_val_if_fail (GDA_IS_SET (set), NULL);
g_return_val_if_fail (set->priv, NULL);
g_return_val_if_fail (GDA_IS_HOLDER (holder), NULL);
- /* FIXME: May is better to use holder's hash for better performance */
g_return_val_if_fail (g_slist_find (set->holders, holder), NULL);
- for (list = set->groups_list; list && !retval; list = list->next) {
+ for (list = set->groups_list; list; list = list->next) {
retval = GDA_SET_GROUP (list->data);
- sublist = gda_set_group_get_nodes (retval);
- while (sublist && !retval) {
+ GSList *sublist;
+ for (sublist = gda_set_group_get_nodes (retval); sublist; sublist = sublist->next) {
node = GDA_SET_NODE (sublist->data);
if (node) {
+ GdaHolder *node_holder;
node_holder = gda_set_node_get_holder (node);
if (node_holder == holder) /* FIXME: May is better to compare holders ID */
break;
- else {
- sublist = g_slist_next (sublist);
- retval = NULL;
- }
}
}
+ if (sublist)
+ break;
}
- return retval;
+ return list ? retval : NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]