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-04-28 18:53:09 +0300
committerJacques Lucke <jacques@blender.org>2020-04-28 18:53:09 +0300
commit67bd6bbcdd0347d078b902ebe9e59692d602b5b1 (patch)
treed1c66265aa08aa49d8d6998fb8782551624a4301 /source/blender/depsgraph/intern/depsgraph_relation.cc
parent05283f8c96c08c34979eaecf4ce4f5b3021c0264 (diff)
Depsgraph: use BLI::Vector for Relations
Reviewers: sergey Differential Revision: https://developer.blender.org/D7556
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_relation.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_relation.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_relation.cc b/source/blender/depsgraph/intern/depsgraph_relation.cc
index cff62540ca8..a4ec48658f5 100644
--- a/source/blender/depsgraph/intern/depsgraph_relation.cc
+++ b/source/blender/depsgraph/intern/depsgraph_relation.cc
@@ -30,12 +30,6 @@
namespace DEG {
-/* TODO(sergey): Find a better place for this. */
-template<typename T> static void remove_from_vector(vector<T> *vector, const T &value)
-{
- vector->erase(std::remove(vector->begin(), vector->end(), value), vector->end());
-}
-
Relation::Relation(Node *from, Node *to, const char *description)
: from(from), to(to), name(description), flag(0)
{
@@ -52,8 +46,8 @@ Relation::Relation(Node *from, Node *to, const char *description)
*
* - Un-registering relation is not a cheap operation, so better to have it
* as an explicit call if we need this. */
- from->outlinks.push_back(this);
- to->inlinks.push_back(this);
+ from->outlinks.append(this);
+ to->inlinks.append(this);
}
Relation::~Relation()
@@ -66,8 +60,8 @@ void Relation::unlink()
{
/* Sanity check. */
BLI_assert(from != nullptr && to != nullptr);
- remove_from_vector(&from->outlinks, this);
- remove_from_vector(&to->inlinks, this);
+ from->outlinks.remove_first_occurrence_and_reorder(this);
+ to->inlinks.remove_first_occurrence_and_reorder(this);
}
} // namespace DEG