Scope of variables

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

 



Hi!

Is it interesting to limit the scope of the variables to where they
are only used?
For example, i is not used inside only one if here in
app/core/gimpimage-convert.c (and thus has been moved to where it's
only necessary):

--- app/core/gimpimage-convert.c.old	2009-11-18 00:18:55.000000000 -0200
+++ app/core/gimpimage-convert.c	2009-11-18 00:19:34.000000000 -0200
@@ -835,8 +835,6 @@
   /*  Convert to indexed?  Build histogram if necessary.  */
   if (new_type == GIMP_INDEXED)
     {
-      gint i;
-
       /* fprintf(stderr, " TO INDEXED(%d) ", num_cols); */

       /* don't dither if the input is grayscale and we are simply
@@ -897,6 +895,7 @@
           ! needs_quantize     &&
           palette_type == GIMP_MAKE_PALETTE)
         {
+          gint i;
           /* If this is an RGB image, and the user wanted a custom-built
            *  generated palette, and this image has no more colours than
            *  the user asked for, we don't need the first pass (quantization).


Are these kind of minor changes interesting for Gimp, please?

Thank you!

Best regards,
Nelson
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux