-----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.
- 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)
- Taking part of the code from long module and putting it into a new
module for readability
Ack, just moves code around
- Adding new functionality to the module created in previous patch
Looks good to me.