BMesh: skip partial updates when there is nothing to do
This commit is contained in:
@@ -292,6 +292,10 @@ void BM_mesh_normals_update_with_partial_ex(BMesh *UNUSED(bm),
|
||||
const struct BMeshNormalsUpdate_Params *params)
|
||||
{
|
||||
BLI_assert(bmpinfo->params.do_normals);
|
||||
/* While harmless, exit early if there is nothing to do. */
|
||||
if (UNLIKELY((bmpinfo->verts_len == 0) && (bmpinfo->faces_len == 0))) {
|
||||
return;
|
||||
}
|
||||
|
||||
BMVert **verts = bmpinfo->verts;
|
||||
BMFace **faces = bmpinfo->faces;
|
||||
|
||||
@@ -406,6 +406,10 @@ void BM_mesh_calc_tessellation_with_partial_ex(BMesh *bm,
|
||||
const struct BMeshCalcTessellation_Params *params)
|
||||
{
|
||||
BLI_assert(bmpinfo->params.do_tessellate);
|
||||
/* While harmless, exit early if there is nothing to do (avoids ensuring the index). */
|
||||
if (UNLIKELY(bmpinfo->faces_len == 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BM_mesh_elem_index_ensure(bm, BM_LOOP | BM_FACE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user