Skip to content

Commit

Permalink
Cleaning up conditional directives that split up parts of statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviomotamedeiros committed Nov 29, 2015
1 parent 3dfc920 commit 93b80c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions maputil.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 93b80c9

Please sign in to comment.