Messages in this thread | | | Date | Mon, 13 Jul 2009 16:52:56 +0200 | From | Joerg Roedel <> | Subject | Re: [GIT PULL] core kernel fixes |
| |
On Fri, Jul 10, 2009 at 12:06:23PM -0700, Linus Torvalds wrote: > What am I missing (apart from the fact that all those variables are > horribly badly named)? > > Also, the tests make no sense. That's not how you are supposed to check > for overlap to begin with.
The tests made sense in my brain when I wrote that function ;-) My code checked for possible overlap scenarios. I havn't thought about doing it much much simpler...
> > Isn't it easier to test for _not_ overlapping? > > /* range1 is fully before range2 */ > (end1 <= start2 || > /* range1 is fully after range2 */ > start1 >= end2)
... by checking for non-overlap and negating the result. But now I know better :-)
Joerg
| |