use continue if NULL instead of a big if block if ...not NULL

also, SplitPoly returns if ps < 0, so there's no need to check for ps >= 0 afterwards
This commit is contained in:
Monster Iestyn 2018-12-14 18:00:08 +00:00
parent 3a125dbbd5
commit 4089b6b8e9

View file

@ -294,8 +294,9 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
// start & end points
pv = fracdivline(bsp, &poly->pts[i], &poly->pts[j]);
if (pv)
{
if (pv == NULL)
continue;
if (ps < 0)
{
// first point
@ -345,7 +346,6 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
// remember last point intercept to detect identical points
lastpv = *pv;
}
}
// no split: the partition line is either parallel and
// aligned with one of the poly segments, or the line is totally
@ -368,7 +368,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
return;
}
if (ps >= 0 && pe < 0)
if (pe < 0)
{
//I_Error("SplitPoly: only one point for split line (%d %d)", ps, pe);
*frontpoly = poly;
@ -482,8 +482,9 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
pv = fracdivline(&cutseg, &poly->pts[i], &poly->pts[j]);
if (pv)
{
if (pv == NULL)
continue;
if (ps < 0)
{
ps = i;
@ -519,7 +520,6 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
break;
}
}
}
// there was a split
if (ps >= 0)