Revert "Cleanup: store results of function calls in const values."
This reverts commit 20c4aa13de
.
Wrong buggy commit breaking tests, and not actually adding anything to
code quality.
This commit is contained in:
@@ -3388,10 +3388,7 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
|
|||||||
if (!ptype) {
|
if (!ptype) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
const bool is_property_group = RNA_struct_is_a(ptype, &RNA_PropertyGroup);
|
if (!RNA_struct_is_a(ptype, &RNA_PropertyGroup) && !RNA_struct_is_ID(ptype)) {
|
||||||
const bool is_id = RNA_struct_is_ID(ptype);
|
|
||||||
|
|
||||||
if (!is_property_group && !is_id) {
|
|
||||||
PyErr_Format(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
"PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
|
"PointerProperty(...) expected an RNA type derived from %.200s or %.200s",
|
||||||
RNA_struct_ui_name(&RNA_ID),
|
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 (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);
|
RNA_def_struct_flag(srna, STRUCT_CONTAINS_DATABLOCK_IDPROPERTIES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user