Andrew Dunstan [EMAIL PROTECTED] writes:
OK, then *This* patch does it the way I think is clearest. Most of it
is just reindenting.
Okay, I applied this patch, and made a few additional cleanups along
the way (the whole function and a couple other things don't need to be
declared in hba.h, for
Neil Conway wrote:
Andrew Dunstan [EMAIL PROTECTED] writes:
OK, then *This* patch does it the way I think is clearest. Most of it
is just reindenting.
Okay, I applied this patch, and made a few additional cleanups along
the way (the whole function and a couple other things don't need to
This time it is my fault, rather than freebsd's ;-)
I think I can do something slightly cleaner than this, though, by
hoisting the buf termination above the test. We could also replace the
strncmp calls with strcmp calls if the buffer has its nul. I will post
something soon.
cheers
andrew
... and here it is. As for the test being outside the if statement, it
is true that that might waste a few cycles, but it hardly matters.
Personally, I would prefer to replace the if statement with this:
if (c == EOF || c == '\n')
{
*buf = '\0';
return;
}
and then it
On Sun, 1 Feb 2004, Andrew Dunstan wrote:
As for the test being outside the if statement, it is true that that
might waste a few cycles, but it hardly matters.
The cycles are not important. My fix wasn't the most optimized either if
one should count cycles. It was terminating the string twice
Andrew Dunstan [EMAIL PROTECTED] writes:
... and then it wouldn't be an issue at all, but I know some people don't
like early function returns - is there a general postgres style rule
about it?
Hardly; we do that a lot. Write it however it seems clearest.
regards,
OK, then *This* patch does it the way I think is clearest. Most of it is
just reindenting.
cheers
andrew
Dennis Bjorklund wrote:
On Sun, 1 Feb 2004, Andrew Dunstan wrote:
As for the test being outside the if statement, it is true that that
might waste a few cycles, but it hardly matters.
Andrew Dunstan [EMAIL PROTECTED] writes:
OK, then *This* patch does it the way I think is clearest. Most of
it is just reindenting.
Unless anyone objects, I'll review and apply this patch within 24
hours.
Thanks for the patch, Dennis and Andrew.
-Neil
---(end of