From d9f39257f40d58caa53efcad112df9775f95d8bf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Jul 2014 11:55:38 +1000 Subject: Math Lib: add compare_len_squared_v3v3 from paint branch --- source/blender/bmesh/operators/bmo_removedoubles.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/bmesh/operators') diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index 814649c7dbf..954f31fc4a8 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -528,6 +528,7 @@ static void bmesh_find_doubles_common(BMesh *bm, BMOperator *op, int i, j, keepvert = 0; const float dist = BMO_slot_float_get(op->slots_in, "dist"); + const float dist_sq = dist * dist; const float dist3 = dist * 3.0f; /* Test whether keep_verts arg exists and is non-empty */ @@ -576,7 +577,7 @@ static void bmesh_find_doubles_common(BMesh *bm, BMOperator *op, continue; } - if (compare_len_v3v3(v_check->co, v_other->co, dist)) { + if (compare_len_squared_v3v3(v_check->co, v_other->co, dist_sq)) { /* If one vert is marked as keep, make sure it will be the target */ if (BMO_elem_flag_test(bm, v_other, VERT_KEEP)) { -- cgit v1.2.3