[SSSD] [PATCHES] Collection related patches

Dmitri Pal dpal at redhat.com
Mon Sep 28 02:56:14 UTC 2009


Resending COLLECTION related patches with issues addressed except
enhancing sorting. For that I opened a ticket.
There is one more patch with new functions and couple of enhancements
added in comparison to the previous one.




Dmitri Pal wrote:
> Jakub Hrozek wrote:
>   
>> 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)?
>>     
> Ok think about the case when you have a flattened collection.
> Imagine you have elements:
> bar
> barcode
> bar.drink1
> bar.drink2
>
> With _BEG but not dot it will match  all of them.
> With _BEG and _DOT it will match "bar", "bar.drink1" and "bar.drink1"
> And this is what I am trying to accomplish at least this is how
> I envision it to be used. That being said there is no use case
> so far and this functionality is not used. When we get into a real case
> of _BEG, _MID and _END
> the functionality may be adjusted.
>   
>> In comparing COL_TYPE_BINARY, after "if (first->length ==
>> second->length)", I think you are missing "else result = NONZERO;"
>>
>>     
> Agree. Will fix.
>
>   
>> 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.
>>
>>     
> I will think about it. Macro is a good idea...
>
>   
>> The swapped != is certainly a bug:
>> if ((res =! 0) && (out_flags == 0)) {
>> if ((res =! 0) && (out_flags == 0)) {
>>
>>     
> Auch... Yes.
>
>   
>> 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)
>>
>>     
> Sure. I needed something quick and dirty that I can put together quickly
> to test the comparisons. I will open a ticket but so far it is not critical
> since sorting is used only for testing comparisons.
>
>
>   
>>>>> 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.
>>
>>     
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel
>
>   


-- 
Thank you,
Dmitri Pal

Engineering Manager IPA project,
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-COLLECTION-Adding-item-comparison-and-sorting.patch
Type: text/x-patch
Size: 30704 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20090927/4491dd26/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-COLLECTION-Realigning-collection-code.patch
Type: text/x-patch
Size: 30097 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20090927/4491dd26/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-COLLECTION-Making-iterations-pinnable.patch
Type: text/x-patch
Size: 11889 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20090927/4491dd26/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-COLLECTION-Enhancing-hashing-and-iteration-functions.patch
Type: text/x-patch
Size: 7262 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20090927/4491dd26/attachment-0003.bin>


More information about the sssd-devel mailing list