[gtk/wip/baedert/for-master: 1/2] label: Remove a redundant assignment




commit b4089672780abd40719ae172fdd02eec229be81a
Author: Timm Bäder <mail baedert org>
Date:   Sun Jan 2 09:46:28 2022 +0100

    label: Remove a redundant assignment
    
    clang-tidy says:
    
    gtklabel.c:1188:15: warning: Although the value stored to 'mid' is used in the enclosing expression, the 
value is never actually read from 'mid'
            min = mid = text_width;
                  ^     ~~~~~~~~~~
    
    Which seems right since mid will be assigned to at the beginning of the
    next loop iteration anyway.

 gtk/gtklabel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 10ee98f5a8..5def4168b6 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1186,7 +1186,7 @@ my_pango_layout_get_width_for_height (PangoLayout *layout,
       pango_layout_get_size (layout, &text_width, &text_height);
       text_width = PANGO_PIXELS_CEIL (text_width);
       if (text_width > mid)
-        min = mid = text_width;
+        min = text_width;
       else if (text_height > for_height)
         min = mid + 1;
       else


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