[gtk/optimize-precompile] builder: Drop empty text chunks when precompiling



commit c5bffb9fb55d25714251b5ef7b9f6e67b7bffb65
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 14 01:06:05 2021 -0500

    builder: Drop empty text chunks when precompiling
    
    These don't add any value either.

 gtk/gtkbuilderprecompile.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkbuilderprecompile.c b/gtk/gtkbuilderprecompile.c
index 5128f3ab4b..398fd75eb2 100644
--- a/gtk/gtkbuilderprecompile.c
+++ b/gtk/gtkbuilderprecompile.c
@@ -314,6 +314,9 @@ record_text (GMarkupParseContext  *context,
   RecordData *data = user_data;
   RecordDataString *string;
 
+  if (text_len == 0)
+    return;
+
   if (!data->current->preserve_whitespace && is_whitespace (text, text_len))
     return;
 


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