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:
authorBastien Montagne <bastien@blender.org>2020-11-02 22:31:12 +0300
committerBastien Montagne <bastien@blender.org>2020-11-02 22:31:12 +0300
commitb9ec6c305cc8c5fe217ea49e36b8edd3ed195f76 (patch)
tree58c8e25a970669453c3bba8ff7c7861ad4867c52 /source/blender/python
parent0277579b2850f0ba097741ca22eb8ae9ccd9bcea (diff)
Revert "Cleanup: store results of function calls in const values."
This reverts commit 20c4aa13de7ba403e113df8ec69c632b6815eac8. Wrong buggy commit breaking tests, and not actually adding anything to code quality.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_props.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index a2552ab25b9..d45c8e8b131 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -3388,10 +3388,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
if (!ptype) {
return NULL;
}
- const bool is_property_group = RNA_struct_is_a(ptype, &RNA_PropertyGroup);
- const bool is_id = RNA_struct_is_ID(ptype);
-
- if (!is_property_group && !is_id) {
+ if (!RNA_struct_is_a(ptype, &RNA_PropertyGroup) && !RNA_struct_is_ID(ptype)) {
PyErr_Format(PyExc_TypeError,
"PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
RNA_struct_ui_name(&RNA_ID),
@@ -3416,7 +3413,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
}
if (RNA_struct_idprops_contains_datablock(ptype)) {
- if (is_property_group) {
+ if (RNA_struct_is_a(srna, &RNA_PropertyGroup)) {
RNA_def_struct_flag(srna, STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES);
}
}