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>2012-08-18 20:16:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-18 20:16:13 +0400
commit27b4b45543c0f7690a1978a60591a0b5c0f1adbb (patch)
tree14c54494059de30d8d4c8a24ec8400b8bcc83ff5 /source/blender/editors/object/object_modifier.c
parente982e9b04f13be046d194643ed28aaedd6181f3b (diff)
utility functions: BLI_findptr, BLI_rfindptr --- use for finding an item in a linked list by a pointer.
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r--source/blender/editors/object/object_modifier.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 47f5a285374..d3b099887cc 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -268,17 +268,12 @@ static int object_modifier_safe_to_delete(Main *bmain, Object *ob,
static int object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
int *sort_depsgraph)
{
- ModifierData *obmd;
-
/* It seems on rapid delete it is possible to
* get called twice on same modifier, so make
* sure it is in list. */
- for (obmd = ob->modifiers.first; obmd; obmd = obmd->next)
- if (obmd == md)
- break;
-
- if (!obmd)
+ if (BLI_findindex(&ob->modifiers, md) != -1) {
return 0;
+ }
/* special cases */
if (md->type == eModifierType_ParticleSystem) {