summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-21 09:58:09 +0100
committerwm4 <wm4@nowhere>2014-11-21 09:58:09 +0100
commite082c2c3dfced1cd20d7c1cb7ee7a661dffc8686 (patch)
tree9f8d1cdf0cbe5db4076f8d7e7656368db01f0b2e /options
parent38f4ec69d11979f2d7734ecf176130814f7f9891 (diff)
downloadmpv-e082c2c3dfced1cd20d7c1cb7ee7a661dffc8686.tar.bz2
mpv-e082c2c3dfced1cd20d7c1cb7ee7a661dffc8686.tar.xz
Remove some unneeded NULL checks
Found by Coverity; also see commit 85fb2af3.
Diffstat (limited to 'options')
-rw-r--r--options/m_option.c29
1 files changed, 13 insertions, 16 deletions
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;