All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] lib/string.c: Two if-clauses merged
@ 2006-10-28 16:30 Andi Drebes
  2006-10-28 18:12 ` Alexey Dobriyan
  2006-11-01  2:09 ` Adrian Bunk
  0 siblings, 2 replies; 3+ messages in thread
From: Andi Drebes @ 2006-10-28 16:30 UTC (permalink / raw)
  To: kernel-janitors

The patch just deletes two lines of code and nothing else. Tested by 
compilation.

Signed-off-by: Andi Drebes <webmaster@programmierforen.de>

--- linux/lib/string.c	2006-10-14 05:34:03.000000000 +0200
+++ patched/lib/string.c	2006-10-28 18:21:11.000000000 +0200
@@ -43,9 +43,7 @@
 			c2 = *s2;
 			s1++;
 			s2++;
-			if (!c1)
-				break;
-			if (!c2)
+			if (!c1 || !c2)
 				break;
 			if (c1 = c2)
 				continue;
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [KJ] [PATCH] lib/string.c: Two if-clauses merged
  2006-10-28 16:30 [KJ] [PATCH] lib/string.c: Two if-clauses merged Andi Drebes
@ 2006-10-28 18:12 ` Alexey Dobriyan
  2006-11-01  2:09 ` Adrian Bunk
  1 sibling, 0 replies; 3+ messages in thread
From: Alexey Dobriyan @ 2006-10-28 18:12 UTC (permalink / raw)
  To: kernel-janitors

On Sat, Oct 28, 2006 at 06:30:18PM +0200, Andi Drebes wrote:
> The patch just deletes two lines of code and nothing else. Tested by
> compilation.

> --- linux/lib/string.c
> +++ patched/lib/string.c
> @@ -43,9 +43,7 @@
>  			c2 = *s2;
>  			s1++;
>  			s2++;
> -			if (!c1)
> -				break;
> -			if (!c2)
> +			if (!c1 || !c2)
>  				break;

Hmm... There are probably thousands of places like this. And checking
one thing at a time is in many cases better than one long check.

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [KJ] [PATCH] lib/string.c: Two if-clauses merged
  2006-10-28 16:30 [KJ] [PATCH] lib/string.c: Two if-clauses merged Andi Drebes
  2006-10-28 18:12 ` Alexey Dobriyan
@ 2006-11-01  2:09 ` Adrian Bunk
  1 sibling, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2006-11-01  2:09 UTC (permalink / raw)
  To: kernel-janitors

On Sat, Oct 28, 2006 at 10:12:57PM +0400, Alexey Dobriyan wrote:
> On Sat, Oct 28, 2006 at 06:30:18PM +0200, Andi Drebes wrote:
> > The patch just deletes two lines of code and nothing else. Tested by
> > compilation.
> 
> > --- linux/lib/string.c
> > +++ patched/lib/string.c
> > @@ -43,9 +43,7 @@
> >  			c2 = *s2;
> >  			s1++;
> >  			s2++;
> > -			if (!c1)
> > -				break;
> > -			if (!c2)
> > +			if (!c1 || !c2)
> >  				break;
> 
> Hmm... There are probably thousands of places like this. And checking
> one thing at a time is in many cases better than one long check.

The generated code is in both cases the same.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-01  2:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-28 16:30 [KJ] [PATCH] lib/string.c: Two if-clauses merged Andi Drebes
2006-10-28 18:12 ` Alexey Dobriyan
2006-11-01  2:09 ` Adrian Bunk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.