label: Remove a redundant assignment
authorTimm Bäder <mail@baedert.org>
Sun, 2 Jan 2022 08:46:28 +0000 (09:46 +0100)
committerTimm Bäder <mail@baedert.org>
Fri, 7 Jan 2022 16:21:37 +0000 (17:21 +0100)
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

index 10ee98f5a81e2ab3abdbec7fdbe18cfb9ef2bdd1..5def4168b69d84c25cb42c0e7c20272e560f709a 100644 (file)
@@ -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