RSS/Atom feed Twitter
Site is read-only, email is disabled

Redundant code in image_convert_indexed_invoker()?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Redundant code in image_convert_indexed_invoker()? Kevin Cozens 31 Jan 07:50
  Redundant code in image_convert_indexed_invoker()? Michael Natterer 31 Jan 13:29
Kevin Cozens
2004-01-31 07:50:50 UTC (about 20 years ago)

Redundant code in image_convert_indexed_invoker()?

Greetings.

While trying to determine if I found a bug in the GIMP (or possibly undocumented behaviour), I ran across what looks like a bit of redundant code.

In the file app/pdb/convert_cmds.c around line 153 is an if statement that checks for a valid range for dither_type. Later (around line 175) is a switch statement that also appears to be checking that the dither_type is one of four allowed values. It seems to me that the switch is not needed.

Michael Natterer
2004-01-31 13:29:01 UTC (about 20 years ago)

Redundant code in image_convert_indexed_invoker()?

Kevin Cozens writes:

Greetings.

While trying to determine if I found a bug in the GIMP (or possibly undocumented behaviour), I ran across what looks like a bit of redundant code.

In the file app/pdb/convert_cmds.c around line 153 is an if statement that checks for a valid range for dither_type. Later (around line 175) is a switch statement that also appears to be checking that the dither_type is one of four allowed values. It seems to me that the switch is not needed.

Good spot!

Will fix that and generally clean up the covert.pdb file a bit.

thanks, --mitch