From 9b6aa740be31b395fc62b4e6e491cba8c8f977e3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 28 Oct 2019 00:36:23 +1100 Subject: Cleanup: remove redundant NULL checks --- source/blender/makesrna/intern/rna_define.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'source/blender/makesrna/intern/rna_define.c') diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index fc22e9e6c74..55aa529a30e 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -3694,15 +3694,13 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, ContainerRNA *cont = cont_; PropertyRNA *prop; - if (!items) { + if (items == NULL) { CLOG_ERROR(&LOG, "items not allowed to be NULL."); return NULL; } prop = RNA_def_property(cont, identifier, PROP_ENUM, PROP_NONE); - if (items) { - RNA_def_property_enum_items(prop, items); - } + RNA_def_property_enum_items(prop, items); RNA_def_property_enum_default(prop, default_value); RNA_def_property_ui_text(prop, ui_name, ui_description); @@ -3720,16 +3718,14 @@ PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont_, ContainerRNA *cont = cont_; PropertyRNA *prop; - if (!items) { + if (items == NULL) { CLOG_ERROR(&LOG, "items not allowed to be NULL."); return NULL; } prop = RNA_def_property(cont, identifier, PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */ - if (items) { - RNA_def_property_enum_items(prop, items); - } + RNA_def_property_enum_items(prop, items); RNA_def_property_enum_default(prop, default_value); RNA_def_property_ui_text(prop, ui_name, ui_description); -- cgit v1.2.3