[gtk+] cssvalue: Remove NULL check



commit a763738f1571059204b1a1fb3d319c4d72f9025f
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jan 15 15:33:53 2013 +0100

    cssvalue: Remove NULL check
    
    The value cannot ever be NULL here.

 gtk/gtkcsscolorvalue.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkcsscolorvalue.c b/gtk/gtkcsscolorvalue.c
index cc7d0d2..9ff0a05 100644
--- a/gtk/gtkcsscolorvalue.c
+++ b/gtk/gtkcsscolorvalue.c
@@ -268,20 +268,17 @@ _gtk_css_color_value_resolve (GtkCssValue             *color,
       g_assert_not_reached ();
     }
 
-  if (value != NULL)
+  if (color->last_value != NULL &&
+      _gtk_css_value_equal (color->last_value, value))
     {
-      if (color->last_value != NULL &&
-          _gtk_css_value_equal (color->last_value, value))
-	{
-	  _gtk_css_value_unref (value);
-	  value = _gtk_css_value_ref (color->last_value);
-	}
-      else
-	{
-	  if (color->last_value != NULL)
-	    _gtk_css_value_unref (color->last_value);
-	  color->last_value = _gtk_css_value_ref (value);
-	}
+      _gtk_css_value_unref (value);
+      value = _gtk_css_value_ref (color->last_value);
+    }
+  else
+    {
+      if (color->last_value != NULL)
+        _gtk_css_value_unref (color->last_value);
+      color->last_value = _gtk_css_value_ref (value);
     }
 
   return value;



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