Refactor: Remove TODO and use constexpr when converting edit bones

No functional changes.

This deals with the TODO
`/* TODO(sergey): How to ensure this is a constexpr? */`
by just making it a `constexpr`.
The line in question was `square_f(0.000001f)`
so the constexpr is just `0.000001f * 0.000001f`

Pull Request: https://projects.blender.org/blender/blender/pulls/142872
This commit is contained in:
Christoph Lendenfeld
2025-07-22 17:38:27 +02:00
committed by Christoph Lendenfeld
parent beb062949b
commit 2a68d9a9a8

View File

@@ -667,11 +667,11 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm)
arm->act_bone = nullptr;
/* Remove zero sized bones, this gives unstable rest-poses. */
constexpr float bone_length_threshold = 0.000001f * 0.000001f;
for (eBone = static_cast<EditBone *>(arm->edbo->first); eBone; eBone = neBone) {
float len_sq = len_squared_v3v3(eBone->head, eBone->tail);
neBone = eBone->next;
/* TODO(sergey): How to ensure this is a `constexpr`? */
if (len_sq <= square_f(0.000001f)) { /* FLT_EPSILON is too large? */
if (len_sq <= bone_length_threshold) { /* FLT_EPSILON is too large? */
/* Find any bones that refer to this bone */
LISTBASE_FOREACH (EditBone *, fBone, arm->edbo) {
if (fBone->parent == eBone) {