Combine identical blocks in CFX_PathData::GetZeroAreaPath().

Also rearrange the code to use more continues.

Change-Id: I1bdf61a8e801323836cd16b0d0a386254ba37354
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/57615
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxge/cfx_pathdata.cpp b/core/fxge/cfx_pathdata.cpp
index cb959f9..df0ce4d 100644
--- a/core/fxge/cfx_pathdata.cpp
+++ b/core/fxge/cfx_pathdata.cpp
@@ -410,22 +410,21 @@
       const FX_PATHPOINT& end = use_prev ? m_Points[next_index - 1] : next;
       NewPath->AppendPoint(start.m_Point, FXPT_TYPE::MoveTo, false);
       NewPath->AppendPoint(end.m_Point, FXPT_TYPE::LineTo, false);
-    } else if (IsFoldingHorizontalLine(prev.m_Point, cur.m_Point,
-                                       next.m_Point)) {
+      continue;
+    }
+
+    if (IsFoldingHorizontalLine(prev.m_Point, cur.m_Point, next.m_Point) ||
+        IsFoldingDiagonalLine(prev.m_Point, cur.m_Point, next.m_Point)) {
       bool use_prev = fabs(cur.m_Point.x - prev.m_Point.x) <
                       fabs(cur.m_Point.x - next.m_Point.x);
       const FX_PATHPOINT& start = use_prev ? prev : cur;
       const FX_PATHPOINT& end = use_prev ? m_Points[next_index - 1] : next;
       NewPath->AppendPoint(start.m_Point, FXPT_TYPE::MoveTo, false);
       NewPath->AppendPoint(end.m_Point, FXPT_TYPE::LineTo, false);
-    } else if (IsFoldingDiagonalLine(prev.m_Point, cur.m_Point, next.m_Point)) {
-      bool use_prev = fabs(cur.m_Point.x - prev.m_Point.x) <
-                      fabs(cur.m_Point.x - next.m_Point.x);
-      const FX_PATHPOINT& start = use_prev ? prev : cur;
-      const FX_PATHPOINT& end = use_prev ? m_Points[next_index - 1] : next;
-      NewPath->AppendPoint(start.m_Point, FXPT_TYPE::MoveTo, false);
-      NewPath->AppendPoint(end.m_Point, FXPT_TYPE::LineTo, false);
-    } else if (IsClosedFigure(prev, next)) {
+      continue;
+    }
+
+    if (IsClosedFigure(prev, next)) {
       NewPath->AppendPoint(prev.m_Point, FXPT_TYPE::MoveTo, false);
       NewPath->AppendPoint(cur.m_Point, FXPT_TYPE::LineTo, false);
       *bThin = true;