Skip to content
Permalink
Browse files

Cleaning up conditional directives that split up parts of statements.

  • Loading branch information
flaviommedeiros committed Nov 29, 2015
1 parent 3dfc920 commit 93b80c95abae2a65a648a6fd1ac02630ec25ae7b
Showing with 4 additions and 3 deletions.
  1. +4 −3 maputil.c
@@ -1711,12 +1711,13 @@ static pointObj point_norm(const pointObj a)
{
double lenmul;
pointObj retv;
int norm_vector;

norm_vector = a.x==0 && a.y==0;
#ifdef USE_POINT_Z_M
if (a.x==0 && a.y==0 && a.z==0 && a.m==0)
#else
if (a.x==0 && a.y==0)
norm_vector = norm_vector && a.z==0 && a.m==0;
#endif
if (norm_vector)
return a;

lenmul=1.0/sqrt(point_abs2(a)); /* this seems to be the costly operation */

0 comments on commit 93b80c9

Please sign in to comment.
You can’t perform that action at this time.