From db0c30af0b5836ffa75d49890edbbdd39495b373 Mon Sep 17 00:00:00 2001 From: ellson Date: Fri, 28 Jan 2005 16:07:59 +0000 Subject: [PATCH] avoids one case of the -O2 bug with icc81 and its a reasonable optimization. --- lib/pathplan/route.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pathplan/route.c b/lib/pathplan/route.c index 4633a2811..80892fdb6 100644 --- a/lib/pathplan/route.c +++ b/lib/pathplan/route.c @@ -505,9 +505,11 @@ static Pvector_t normv(Pvector_t v) { double d; - d = sqrt(v.x * v.x + v.y * v.y); - if (d != 0) + d = v.x * v.x + v.y * v.y; + if (d > 1e-6) { + d = sqrt(d); v.x /= d, v.y /= d; + } return v; } -- 2.40.0