Date: 04/30/98
- Next message: Zeev Suraski: "Re: [PHP-DEV] Bug #333: Build failure on shared php load"
- Previous message: Zeev Suraski: "Re: [PHP-DEV] Bug #332: php.cgi -e merge.php3p dumps core"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 23:36 29/04/98 -0400, Rasmus Lerdorf wrote:
>> * Removed a lot of redundant code from set_socket_blocking() (renamed it
to set_socket_blocking)
>> If this code was taken as-is from somewhere else (which I guess it
was) - there's a lot of
>> optimization that can be done.
>
>Why the rename? set_blocking() also needs to work on popen'ed file
>descriptors and as such is not limited to operating on sockets. I just
>hadn't quite figured out how to do this yet. Hence some of the "redundant"
>code. And no, it wasn't taken from anywhere else.
The redundant code was redundant in an 'absolute' way, that is, it was
redundant anyway. E.g., there's no reason to look the resource in the list
twice, just because you'll be using it as int * here and as FILE * there -
a simple cast would do.
Another thing you may have noticed is changing indentation and adding
braces even on simple if's, e.g.
if (foo) {
bar;
}
instead of
if(foo) bar;
It might be my brain working underclocked or something, but the former is
much more readable than the latter. If you want the code to also be
servicable by me, please stick with generally, always using braces and
whitespace in the K&R style... It might encourage you guys to know that on
my new 'job', I'll forced to use about the lamest indentation standard in
existence :) It's not even one of the standards that 'indent' recognizes.
By the way, I seriously doubt there's a platform independant way to set
blocking on FILE * pointers, which is why I believed this would be
socket-only, hence the name change (setting a more specific name is always
a better idea, when applicable - otherwise, sooner or later, you can end up
having that function name misleading). If you believe it'd work with FILE
* pointers in the future, I'll reverse the name change...
Zeev
-- Zeev Suraski <zeev <email protected>> For a PGP public key, finger bourbon <email protected>
- Next message: Zeev Suraski: "Re: [PHP-DEV] Bug #333: Build failure on shared php load"
- Previous message: Zeev Suraski: "Re: [PHP-DEV] Bug #332: php.cgi -e merge.php3p dumps core"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

