[gimp] file-ps: Convert if statement to switch



commit a58abcee0d0e450ce8eece88366ddb84f67575a5
Author: Mukund Sivaraman <muks banu com>
Date:   Mon May 13 17:59:17 2013 +0530

    file-ps: Convert if statement to switch

 plug-ins/common/file-ps.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c
index 1763ea1..9eef361 100644
--- a/plug-ins/common/file-ps.c
+++ b/plug-ins/common/file-ps.c
@@ -1790,9 +1790,18 @@ create_new_image (const gchar        *filename,
   GimpImageType  gdtype;
   gchar         *tmp;
 
-  if (type == GIMP_GRAY) gdtype = GIMP_GRAY_IMAGE;
-  else if (type == GIMP_INDEXED) gdtype = GIMP_INDEXED_IMAGE;
-  else gdtype = GIMP_RGB_IMAGE;
+  switch (type)
+    {
+    case GIMP_GRAY:
+      gdtype = GIMP_GRAY_IMAGE;
+      break;
+    case GIMP_INDEXED:
+      gdtype = GIMP_INDEXED_IMAGE;
+      break;
+    case GIMP_RGB:
+    default:
+      gdtype = GIMP_RGB_IMAGE;
+    }
 
   image_ID = gimp_image_new (width, height, type);
   gimp_image_undo_disable (image_ID);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]