From 92bc6ce5bdc4f7b40369b298c56cf4d471d09cb9 Mon Sep 17 00:00:00 2001 From: Bill Bierman Date: Tue, 19 Jan 2016 07:47:45 -1000 Subject: [PATCH] Change if to else-if to avoid unnecessary comparison --- Recast/Source/RecastFilter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Recast/Source/RecastFilter.cpp b/Recast/Source/RecastFilter.cpp index e17105b..9d3e63c 100644 --- a/Recast/Source/RecastFilter.cpp +++ b/Recast/Source/RecastFilter.cpp @@ -154,11 +154,12 @@ void rcFilterLedgeSpans(rcContext* ctx, const int walkableHeight, const int walk // The current span is close to a ledge if the drop to any // neighbour span is less than the walkableClimb. if (minh < -walkableClimb) + { s->area = RC_NULL_AREA; - + } // If the difference between all neighbours is too large, // we are at steep slope, mark the span as ledge. - if ((asmax - asmin) > walkableClimb) + else if ((asmax - asmin) > walkableClimb) { s->area = RC_NULL_AREA; }