[gimp] Optimize gimp_statusbar_replace_valist()



commit a4694d8a0ae2f6b48a38040b3ca6b08a7cde47ba
Author: Michael Natterer <mitch gimp org>
Date:   Tue Nov 3 15:49:18 2009 +0100

    Optimize gimp_statusbar_replace_valist()
    
    Don't replace anything if the status message didn't change. Gets rid
    of quite some statusbar invalidations in many tools.

 app/display/gimpstatusbar.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index c28b5c4..42e7778 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -1051,6 +1051,12 @@ gimp_statusbar_replace_valist (GimpStatusbar *statusbar,
 
       if (msg->context_id == context_id)
         {
+          if (strcmp (msg->text, message) == 0)
+            {
+              g_free (message);
+              return;
+            }
+
           g_free (msg->stock_id);
           msg->stock_id = g_strdup (stock_id);
 



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