From e082c2c3dfced1cd20d7c1cb7ee7a661dffc8686 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 21 Nov 2014 09:58:09 +0100 Subject: Remove some unneeded NULL checks Found by Coverity; also see commit 85fb2af3. --- options/m_option.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'options') diff --git a/options/m_option.c b/options/m_option.c index 9ec6ccc427..ce86db0696 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2288,23 +2288,20 @@ bool m_obj_list_find(struct m_obj_desc *dst, const struct m_obj_list *l, if (bstr_equals0(name, dst->name)) return true; } - if (l->aliases) { - for (int i = 0; l->aliases[i][0]; i++) { - const char *aname = l->aliases[i][0]; - const char *alias = l->aliases[i][1]; - const char *opts = l->aliases[i][2]; - if (bstr_equals0(name, aname) && - m_obj_list_find(dst, l, bstr0(alias))) - { - if (opts) { - dst->init_options = opts; - } else { - // Assume it's deprecated in this case. - // Also, it's used by the VO code only, so whatever. - dst->replaced_name = aname; - } - return true; + for (int i = 0; l->aliases[i][0]; i++) { + const char *aname = l->aliases[i][0]; + const char *alias = l->aliases[i][1]; + const char *opts = l->aliases[i][2]; + if (bstr_equals0(name, aname) && m_obj_list_find(dst, l, bstr0(alias))) + { + if (opts) { + dst->init_options = opts; + } else { + // Assume it's deprecated in this case. + // Also, it's used by the VO code only, so whatever. + dst->replaced_name = aname; } + return true; } } return false; -- cgit v1.2.3