diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-22 18:15:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-22 18:15:28 +0400 |
commit | 0bab23633a07942586f963c19d053f26c44d799b (patch) | |
tree | 77065471bb213e0c782aa955eb77d1ca3a728d88 /source/blender/editors/object/object_vgroup.c | |
parent | 96429a4792cb2b30c8e96ab6cedcd3f6c884fc38 (diff) |
remove inline loops in a few places
replace with defgroup_find_name() and BLI_findstring()
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 5cdabcab41a..377a4d15675 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -532,18 +532,8 @@ float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum) } void ED_vgroup_select_by_name(Object *ob, char *name) -{ - bDeformGroup *curdef; - int actdef= 1; - - for(curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++){ - if(!strcmp(curdef->name, name)) { - ob->actdef= actdef; - return; - } - } - - ob->actdef= 0; // this signals on painting to create a new one, if a bone in posemode is selected */ +{ /* note: ob->actdef==0 signals on painting to create a new one, if a bone in posemode is selected */ + ob->actdef= defgroup_name_index(ob, name) + 1; } /********************** Operator Implementations *********************/ |