[gtk/wip/otte/css: 120/128] cssnode: Remove redundant check



commit 3177ac4270b1f1247f8bcaa3d3a5b62f40fc0247
Author: Benjamin Otte <otte redhat com>
Date:   Tue Feb 4 23:24:50 2020 +0100

    cssnode: Remove redundant check
    
    We assert that cssnode->parent is NULL, no need to check it again.

 gtk/gtkcssnode.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index ebc65a8d43..24c11ddb5f 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -1359,17 +1359,14 @@ gtk_css_node_validate (GtkCssNode *cssnode)
 
   gtk_css_node_validate_internal (cssnode, &filter, timestamp);
 
-  if (cssnode->parent == NULL)
+  if (gdk_profiler_is_running ())
     {
-      if (gdk_profiler_is_running ())
-        {
-          gint64 after = g_get_monotonic_time ();
-          gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "css validation", "");
-          gdk_profiler_set_int_counter (invalidated_nodes_counter, after * 1000, invalidated_nodes);
-          gdk_profiler_set_int_counter (created_styles_counter, after * 1000, created_styles);
-          invalidated_nodes = 0;
-          created_styles = 0;
-        }
+      gint64 after = g_get_monotonic_time ();
+      gdk_profiler_add_mark (before * 1000, (after - before) * 1000, "css validation", "");
+      gdk_profiler_set_int_counter (invalidated_nodes_counter, after * 1000, invalidated_nodes);
+      gdk_profiler_set_int_counter (created_styles_counter, after * 1000, created_styles);
+      invalidated_nodes = 0;
+      created_styles = 0;
     }
 }
 


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