Skip to content

Commit

Permalink
Merge pull request #5200 from flaviommedeiros/branch-7-0
Browse files Browse the repository at this point in the history
Cleaning up conditional directives that split up parts of statements (#5200)
  • Loading branch information
tbonfort committed Nov 30, 2015
2 parents 3dfc920 + 93b80c9 commit 157fa47
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 157fa47

Please sign in to comment.