[Users] Redundant code?

Ricardo Mones ricardo at mones.org
Mon Jan 26 10:42:31 CET 2015


Hi Pierre,

On Sun, Jan 25, 2015 at 11:20:36AM -0500, Pierre Fortin wrote:
> Hi devs,
> 
> While responding to the "Error while sending..." thread, I browsed
> the code and noticed something strange...  Starting at compose.c:5193, I
> see the below logic. [Not being critical; just pointing out what appears
> to be redundant code.]
> 
> if (!discard_window) {
> 	if (val != 0) {
> 		[do code block]
> 	}
> }
> if (val != 0) {
> 	if (!discard_window) {
> 		[do identical code block]
> 	}
> } else {

Actual code is¹:

5194         if (!discard_window) {
5195                 if (val != 0) {
…
5211         if (val == 0) {
…
5224                 if (!discard_window) {

So, you read it somewhat wrong at line 5211 ;-)

Anyway, thanks for taking care of checking the source!

¹ http://git.claws-mail.org/?p=claws.git;a=blob;f=src/compose.c;h=ab951c4f#l5194
-- 
  Ricardo Mones 
  ~
  Physics is like sex: sure, it may give some practical results, but 
  that's not why we do it.                            Richard Feynman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20150126/40758776/attachment.sig>


More information about the Users mailing list