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>2020-06-10 15:12:24 +0300
committerJacques Lucke <jacques@blender.org>2020-06-10 15:15:04 +0300
commit84a0a6d16c85105cf755141c4d49afc52eb157e3 (patch)
tree2b751e4dc6cb98cbb04459eb0b8c89db5d969cf5 /source/blender/depsgraph
parentf367f1e5a55e1c657f9d2088f6537fb2e73492f0 (diff)
BLI: update behavior of Map.lookup_or_add
Previously, this function would expect a callback function as parameter. This behavior is now in Map.lookup_or_add_cb. The new version just takes the key and value directly.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_rna.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_physics.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
index 94f58427251..fbd53bf46f8 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc
@@ -364,7 +364,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr,
RNANodeQueryIDData *RNANodeQuery::ensure_id_data(const ID *id)
{
- unique_ptr<RNANodeQueryIDData> &id_data = id_data_map_.lookup_or_add(
+ unique_ptr<RNANodeQueryIDData> &id_data = id_data_map_.lookup_or_add_cb(
id, [&]() { return blender::make_unique<RNANodeQueryIDData>(id); });
return id_data.get();
}
diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc b/source/blender/depsgraph/intern/depsgraph_physics.cc
index 44c3d23ace4..ad67117fda3 100644
--- a/source/blender/depsgraph/intern/depsgraph_physics.cc
+++ b/source/blender/depsgraph/intern/depsgraph_physics.cc
@@ -167,7 +167,7 @@ ListBase *build_effector_relations(Depsgraph *graph, Collection *collection)
graph->physics_relations[DEG_PHYSICS_EFFECTOR] = new Map<const ID *, ListBase *>();
hash = graph->physics_relations[DEG_PHYSICS_EFFECTOR];
}
- return hash->lookup_or_add(&collection->id, [&]() {
+ return hash->lookup_or_add_cb(&collection->id, [&]() {
::Depsgraph *depsgraph = reinterpret_cast<::Depsgraph *>(graph);
return BKE_effector_relations_create(depsgraph, graph->view_layer, collection);
});
@@ -183,7 +183,7 @@ ListBase *build_collision_relations(Depsgraph *graph,
graph->physics_relations[type] = new Map<const ID *, ListBase *>();
hash = graph->physics_relations[type];
}
- return hash->lookup_or_add(&collection->id, [&]() {
+ return hash->lookup_or_add_cb(&collection->id, [&]() {
::Depsgraph *depsgraph = reinterpret_cast<::Depsgraph *>(graph);
return BKE_collision_relations_create(depsgraph, collection, modifier_type);
});