Changeset: c5b17681b55e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/c5b17681b55e Modified Files: sql/server/rel_exp.c Branch: default Log Message:
remove redundant if-scope diffs (68 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -2579,38 +2579,36 @@ exps_bind_column2(list *exps, const char if (exps) { node *en; - if (exps) { - if (!exps->ht && list_length(exps) > HASH_MIN_SIZE) { - exps->ht = hash_new(exps->sa, list_length(exps), (fkeyvalue)&exp_key); - if (exps->ht == NULL) - return res; - - for (en = exps->h; en; en = en->next ) { - sql_exp *e = en->data; - if (e->alias.name) { - int key = exp_key(e); - - if (hash_add(exps->ht, key, e) == NULL) - return res; - } + if (!exps->ht && list_length(exps) > HASH_MIN_SIZE) { + exps->ht = hash_new(exps->sa, list_length(exps), (fkeyvalue)&exp_key); + if (exps->ht == NULL) + return res; + + for (en = exps->h; en; en = en->next ) { + sql_exp *e = en->data; + if (e->alias.name) { + int key = exp_key(e); + + if (hash_add(exps->ht, key, e) == NULL) + return res; } } - if (exps->ht) { - int key = hash_key(cname); - sql_hash_e *he = exps->ht->buckets[key&(exps->ht->size-1)]; - - for (; he; he = he->chain) { - sql_exp *e = he->value; - - if (e && e->alias.name && e->alias.rname && strcmp(e->alias.name, cname) == 0 && strcmp(e->alias.rname, rname) == 0) { - if (res && multiple) - *multiple = 1; - if (!res) - res = e; - } + } + if (exps->ht) { + int key = hash_key(cname); + sql_hash_e *he = exps->ht->buckets[key&(exps->ht->size-1)]; + + for (; he; he = he->chain) { + sql_exp *e = he->value; + + if (e && e->alias.name && e->alias.rname && strcmp(e->alias.name, cname) == 0 && strcmp(e->alias.rname, rname) == 0) { + if (res && multiple) + *multiple = 1; + if (!res) + res = e; } - return res; } + return res; } for (en = exps->h; en; en = en->next ) { sql_exp *e = en->data; _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org