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:
authorCampbell Barton <ideasman42@gmail.com>2013-10-01 15:44:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-10-01 15:44:39 +0400
commitd370c7619fad3aa2ae4f0bedce4c925c7b05aa15 (patch)
treea06848abf311c510c420d6a79cc6aea8a6c079ef /source/blender/blenkernel/intern/node.c
parent404274040b48d8898154b8733edbc1f77a78e36e (diff)
replace inline searches for BLI_findindex
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r--source/blender/blenkernel/intern/node.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index ebafb98f6ec..44776bc9b2e 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1118,11 +1118,8 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, Main *bmain, bool do_
if (bmain) {
/* is ntree part of library? */
- for (newtree = bmain->nodetree.first; newtree; newtree = newtree->id.next) {
- if (newtree == ntree) {
- newtree = BKE_libblock_copy(&ntree->id);
- break;
- }
+ if (BLI_findindex(&bmain->nodetree, ntree) != -1) {
+ newtree = BKE_libblock_copy(&ntree->id);
}
}
else
@@ -1669,14 +1666,8 @@ static void free_localized_node_groups(bNodeTree *ntree)
for (node = ntree->nodes.first; node; node = node->next) {
if (node->type == NODE_GROUP && node->id) {
- bNodeTree *ngroup = (bNodeTree *)node->id, *tntree;
-
- /* is ntree part of library? */
- for (tntree = G.main->nodetree.first; tntree; tntree = tntree->id.next)
- if (tntree == ngroup)
- break;
-
- if (tntree == NULL) {
+ bNodeTree *ngroup = (bNodeTree *)node->id;
+ if (BLI_findindex(&G.main->nodetree, ngroup) == -1) {
/* ntree is not in library, i.e. localized node group: free it */
ntreeFreeTree_ex(ngroup, false);
MEM_freeN(ngroup);