Fix Logically dead code
authorJaehwan Kim <jae.hwan.kim.neo@gmail.com>
Wed, 9 Jan 2013 10:32:52 +0000 (10:32 +0000)
committerJaehwan Kim <jae.hwan.kim.neo@gmail.com>
Wed, 9 Jan 2013 10:32:52 +0000 (10:32 +0000)
SVN revision: 82450

legacy/elementary/src/lib/els_box.c

index a35e1d7..aa30a24 100644 (file)
@@ -8,6 +8,7 @@ _smart_extents_calculate(Evas_Object *box, Evas_Object_Box_Data *priv, int horiz
    Evas_Coord minw, minh, mnw, mnh, maxw, maxh;
    const Eina_List *l;
    Evas_Object_Box_Option *opt;
+   Eina_Bool max = EINA_TRUE;
    int c;
 
    minw = 0;
@@ -67,19 +68,27 @@ _smart_extents_calculate(Evas_Object *box, Evas_Object_Box_Data *priv, int horiz
              evas_object_size_hint_max_get(opt->obj, &mnw, &mnh);
              if (horizontal)
                {
-                  if (mnw < 0) maxw = -1;
-                  if (maxw != -1)
+                  if (mnw < 0)
                     {
-                       if (maxw > mnw) maxw = mnw;
+                       maxw = -1;
+                       max = EINA_FALSE;
+                    }
+                  if (max)
+                    {
+                       if (maxh > mnh) maxh = mnh;
                        maxw += mnw;
                     }
                }
              else
                {
-                  if (mnh < 0) maxh = -1;
-                  if (maxh != -1)
+                  if (mnh < 0)
                     {
-                       if (maxh > mnh) maxh = mnh;
+                       maxh = -1;
+                       max = EINA_FALSE;
+                    }
+                  if (max)
+                    {
+                       if (maxw > mnw) maxw = mnw;
                        maxh += mnh;
                     }
                }