Dylan Smith : richedit: Implement ME_DITypesEqual using a switch statment.

Alexandre Julliard julliard at winehq.org
Mon Aug 10 10:36:25 CDT 2009


Module: wine
Branch: master
Commit: 67826276248e98ddfc9c6fe1f1d0e6434aee84ae
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=67826276248e98ddfc9c6fe1f1d0e6434aee84ae

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Mon Aug 10 10:53:21 2009 -0400

richedit: Implement ME_DITypesEqual using a switch statment.

---

 dlls/riched20/list.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/dlls/riched20/list.c b/dlls/riched20/list.c
index d3d9463..06f1121 100644
--- a/dlls/riched20/list.c
+++ b/dlls/riched20/list.c
@@ -44,23 +44,23 @@ void ME_Remove(ME_DisplayItem *diWhere)
 
 static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass)
 {
-  if (type==nTypeOrClass)
-    return TRUE;
-  if (nTypeOrClass==diRunOrParagraph && (type==diRun || type==diParagraph))
-    return TRUE;
-  if (nTypeOrClass==diRunOrStartRow && (type==diRun || type==diStartRow))
-    return TRUE;
-  if (nTypeOrClass==diParagraphOrEnd && (type==diTextEnd || type==diParagraph))
-    return TRUE;
-  if (nTypeOrClass==diStartRowOrParagraph && (type==diStartRow || type==diParagraph))
-    return TRUE;
-  if (nTypeOrClass==diStartRowOrParagraphOrEnd
-    && (type==diStartRow || type==diParagraph || type==diTextEnd))
-    return TRUE;
-  if (nTypeOrClass==diRunOrParagraphOrEnd
-    && (type==diRun || type==diParagraph || type==diTextEnd))
-    return TRUE;
-  return FALSE;
+  switch (nTypeOrClass)
+  {
+    case diRunOrParagraph:
+      return type == diRun || type == diParagraph;
+    case diRunOrStartRow:
+      return type == diRun || type == diStartRow;
+    case diParagraphOrEnd:
+      return type == diTextEnd || type == diParagraph;
+    case diStartRowOrParagraph:
+      return type == diStartRow || type == diParagraph;
+    case diStartRowOrParagraphOrEnd:
+      return type == diStartRow || type == diParagraph || type == diTextEnd;
+    case diRunOrParagraphOrEnd:
+      return type == diRun || type == diParagraph || type == diTextEnd;
+    default:
+      return type == nTypeOrClass;
+  }
 }
 
 ME_DisplayItem *ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass)




More information about the wine-cvs mailing list