Avoid per-constraint-target call of strlen

It's enough to do one single comparison to see if the string is empty or not.
This commit is contained in:
Sergey Sharybin
2016-05-10 17:15:16 +02:00
parent 2786b0bc9d
commit e343e4a5ba

View File

@@ -538,7 +538,7 @@ static void contarget_get_lattice_mat(Object *ob, const char *substring, float m
static void constraint_target_to_mat4(Object *ob, const char *substring, float mat[4][4], short from, short to, float headtail) static void constraint_target_to_mat4(Object *ob, const char *substring, float mat[4][4], short from, short to, float headtail)
{ {
/* Case OBJECT */ /* Case OBJECT */
if (!strlen(substring)) { if (substring[0] == '\0') {
copy_m4_m4(mat, ob->obmat); copy_m4_m4(mat, ob->obmat);
BKE_constraint_mat_convertspace(ob, NULL, mat, from, to, false); BKE_constraint_mat_convertspace(ob, NULL, mat, from, to, false);
} }