[SSSD] [PATCHES] Collection related patches
Jakub Hrozek
jhrozek at redhat.com
Thu Sep 17 17:21:28 UTC 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 09/17/2009 06:08 AM, Dmitri Pal wrote:
> Dmitri Pal wrote:
>> > See patch comments for details.
>> > All three are not massive.
>> > 1) Comparison and sorting collections
I don't understand why are you testing for
"first->property[second->property_len] != '\0'" when testing for
COL_CMPIN_PROP_DOT? Does that mean that comparing the exactly same
properties with _BEG and COL_CMPIN_PROP_DOT would compare OK (In other
words, I care about dot only with strings that are not equal)?
In comparing COL_TYPE_BINARY, after "if (first->length ==
second->length)", I think you are missing "else result = NONZERO;"
For other types, I'm wondering if the code could be somehow refactored
(with a macro perhaps), it's essentially 6 blocks of the very same code
except for the cast.
The swapped != is certainly a bug:
if ((res =! 0) && (out_flags == 0)) {
if ((res =! 0) && (out_flags == 0)) {
In general, is it possible to use some other sorting algorithm than the
one used? It appears to be a variant of bubble sort which is not very
effective. Maybe qsort from the standard C library could be used, but
I'm not sure how to deal with the flags..maybe a wrapper could be used
(as qsort only works based on return value)
>> > 2) Taking part of the code from long module and putting it into a new
>> > module for readability
Ack, just moves code around
>> > 3) Adding new functionality to the module created in previous patch
>> >
Looks good to me.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkqycBcACgkQHsardTLnvCUoYgCgtpqML1s/WPkHmmQZCEZ13OrI
3+UAnRn4Y/nsZnqPuPZb7qkX9Ywoz3Ec
=Av3j
-----END PGP SIGNATURE-----
More information about the sssd-devel
mailing list