Cleanup: order checks to skip redundant function calls

This commit is contained in:
Campbell Barton
2024-01-15 22:57:28 +11:00
parent 195bb4f8f5
commit 6f3702740b
2 changed files with 4 additions and 2 deletions

View File

@@ -1633,7 +1633,9 @@ bool BKE_id_new_name_validate(
}
result = BKE_main_namemap_get_name(bmain, id, name, false);
result |= !STREQ(id->name + 2, name);
if (!result && !STREQ(id->name + 2, name)) {
result = true;
}
BLI_strncpy(id->name + 2, name, sizeof(id->name) - 2);
id_sort_by_name(lb, id, nullptr);

View File

@@ -280,7 +280,7 @@ void drawSnapping(TransInfo *t)
rv3d, source_loc, target_loc, t->tsnap.source_type, t->tsnap.target_type, col, activeCol);
/* Draw normal if needed. */
if (usingSnappingNormal(t) && validSnappingNormal(t) && target_loc) {
if (target_loc && usingSnappingNormal(t) && validSnappingNormal(t)) {
uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);