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:
authorJacques Lucke <jacques@blender.org>2021-01-25 18:20:10 +0300
committerJacques Lucke <jacques@blender.org>2021-01-25 18:25:27 +0300
commit8a77019474c1a4d05fb74bb86031ff75c116f751 (patch)
treeeadbdb78821f1aedb8d2829d583243dd1114bc4f /intern/cycles/blender/blender_python.cpp
parent04f91bce53bd50fc492130ada8869f97ae205f9a (diff)
Cycles: modernize usage of rna iterators
Using rna iterators in range-based for loops is possible since {rBc4286ddb095d32714c9d5f10751a14f5871b3844}. This patch only updates the places that are easy to update without more changes in surrounding code. Differential Revision: https://developer.blender.org/D10195
Diffstat (limited to 'intern/cycles/blender/blender_python.cpp')
-rw-r--r--intern/cycles/blender/blender_python.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp
index 525525e1047..5646bd5b2eb 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -597,22 +597,19 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
bool removed;
do {
- BL::Node::inputs_iterator b_input;
- BL::Node::outputs_iterator b_output;
-
removed = false;
- for (b_node.inputs.begin(b_input); b_input != b_node.inputs.end(); ++b_input) {
- if (used_sockets.find(b_input->ptr.data) == used_sockets.end()) {
- b_node.inputs.remove(b_data, *b_input);
+ for (BL::NodeSocket &b_input : b_node.inputs) {
+ if (used_sockets.find(b_input.ptr.data) == used_sockets.end()) {
+ b_node.inputs.remove(b_data, b_input);
removed = true;
break;
}
}
- for (b_node.outputs.begin(b_output); b_output != b_node.outputs.end(); ++b_output) {
- if (used_sockets.find(b_output->ptr.data) == used_sockets.end()) {
- b_node.outputs.remove(b_data, *b_output);
+ for (BL::NodeSocket &b_output : b_node.outputs) {
+ if (used_sockets.find(b_output.ptr.data) == used_sockets.end()) {
+ b_node.outputs.remove(b_data, b_output);
removed = true;
break;
}