From ce4b5db49434ef1db88109b27d98d69fd100de89 Mon Sep 17 00:00:00 2001
From: Inuyasha <MattWCSTRFAN@gmail.com>
Date: Thu, 5 May 2016 07:20:53 -0700
Subject: [PATCH] organize conditions in a more optimized way the most common
 condition (correct drawing) shouldn't be last, however it can't be first
 without making the conditions longer anyway.

it's a nitpicky thing, but this is the renderer we're talking about here.
---
 src/r_segs.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/r_segs.c b/src/r_segs.c
index a5aec03469..120735be3a 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -1025,11 +1025,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 
 #ifdef ESLOPE
 				if      (top_frac > (INT64)CLAMPMAX) sprtopscreen = windowtop = CLAMPMAX;
-				else if (top_frac < (INT64)CLAMPMIN) sprtopscreen = windowtop = CLAMPMIN;
-				else                                 sprtopscreen = windowtop = (fixed_t)top_frac;
+				else if (top_frac > (INT64)CLAMPMIN) sprtopscreen = windowtop = (fixed_t)top_frac;
+				else                                 sprtopscreen = windowtop = CLAMPMIN;
 				if      (bottom_frac > (INT64)CLAMPMAX) sprbotscreen = windowbottom = CLAMPMAX;
-				else if (bottom_frac < (INT64)CLAMPMIN) sprbotscreen = windowbottom = CLAMPMIN;
-				else                                    sprbotscreen = windowbottom = (fixed_t)bottom_frac;
+				else if (bottom_frac > (INT64)CLAMPMIN) sprbotscreen = windowbottom = (fixed_t)bottom_frac;
+				else                                    sprbotscreen = windowbottom = CLAMPMIN;
 
 				top_frac += top_step;
 				bottom_frac += bottom_step;
@@ -1176,11 +1176,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
 
 #ifdef ESLOPE
 			if      (top_frac > (INT64)CLAMPMAX) sprtopscreen = windowtop = CLAMPMAX;
-			else if (top_frac < (INT64)CLAMPMIN) sprtopscreen = windowtop = CLAMPMIN;
-			else                                 sprtopscreen = windowtop = (fixed_t)top_frac;
+			else if (top_frac > (INT64)CLAMPMIN) sprtopscreen = windowtop = (fixed_t)top_frac;
+			else                                 sprtopscreen = windowtop = CLAMPMIN;
 			if      (bottom_frac > (INT64)CLAMPMAX) sprbotscreen = windowbottom = CLAMPMAX;
-			else if (bottom_frac < (INT64)CLAMPMIN) sprbotscreen = windowbottom = CLAMPMIN;
-			else                                    sprbotscreen = windowbottom = (fixed_t)bottom_frac;
+			else if (bottom_frac > (INT64)CLAMPMIN) sprbotscreen = windowbottom = (fixed_t)bottom_frac;
+			else                                    sprbotscreen = windowbottom = CLAMPMIN;
 
 			top_frac += top_step;
 			bottom_frac += bottom_step;
-- 
GitLab