Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-10-27 16:36:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-10-27 16:40:51 +0300
commit9b6aa740be31b395fc62b4e6e491cba8c8f977e3 (patch)
tree20f84c6298b8fdb62a06a954050078127ab335d6 /source/blender/makesrna/intern/rna_define.c
parentf1824e6ec45fa0d7c0a01d50ace45ec28595d07d (diff)
Cleanup: remove redundant NULL checks
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c12
1 files changed, 4 insertions, 8 deletions
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);