summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/dict.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index b4a97a9b68e..fc31e01ee9a 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -207,17 +207,17 @@ are_dicts_equal (dict_t *one, dict_t *two,
if (!match)
match = dict_match_everything;
- cmp.dict = two;
- cmp.value_ignore = value_ignore;
- if (!two) {
- num_matches1 = dict_foreach_match (one, match, NULL,
- dict_null_foreach_fn, NULL);
+ if ((one == NULL) || (two == NULL)) {
+ num_matches1 = dict_foreach_match(one ? one : two, match, NULL,
+ dict_null_foreach_fn, NULL);
goto done;
- } else {
- num_matches1 = dict_foreach_match (one, match, NULL,
- key_value_cmp, &cmp);
}
+ cmp.dict = two;
+ cmp.value_ignore = value_ignore;
+ num_matches1 = dict_foreach_match (one, match, NULL, key_value_cmp,
+ &cmp);
+
if (num_matches1 == -1)
return _gf_false;