Useless loop?

Gerald W. Carter cartegw at Eng.Auburn.EDU
Thu Nov 4 18:51:45 GMT 1999


"Naccarato, Robert" wrote:
> 
> DEBUG( 3, ( "%s is in %d groups: ", user, ngroups ) );
> for (i = 0; i < ngroups; i++ )
> {
>         DEBUG( 3, ( "%s%d", (i ? ", " : ""), (int)groups[i] ) );
> }
> DEBUG( 3, ( "\n" ) );

You are technically correct.  However, in my experience most 
users are only in a few groups (2 - 3 maybe).  On the high
end a sysadmin may be in 16 groups.  Therefore ngroups
is fairly low and should not really cost you much to loop.





Cheers,
jerry
________________________________________________________________________
                            Gerald ( Jerry ) Carter	
Engineering Network Services                           Auburn University 
jerry at eng.auburn.edu             http://www.eng.auburn.edu/users/cartegw

       "...a hundred billion castaways looking for a home."
                                  - Sting "Message in a Bottle" ( 1979 )


More information about the samba-technical mailing list