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:
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