add BLI_ghash_pop() which returns the value for a key and removes it at the same...
[blender.git] / source / blender / editors / sculpt_paint / paint_vertex.c
index c5c08a94ae533c3e452d15800af8f0114b5d9b3e..e05191dad3b92b7630884b15526b7f19697f52e8 100644 (file)
@@ -2100,8 +2100,7 @@ static char *wpaint_make_validmap(Object *ob)
                                        if (chan->bone->flag & BONE_NO_DEFORM)
                                                continue;
 
-                                       if (BLI_ghash_haskey(gh, chan->name)) {
-                                               BLI_ghash_remove(gh, chan->name, NULL, NULL);
+                                       if (BLI_ghash_remove(gh, chan->name, NULL, NULL)) {
                                                BLI_ghash_insert(gh, chan->name, SET_INT_IN_POINTER(1));
                                        }
                                }