#1856 ding-libs.collection: comparision has no effect
Closed: Fixed Opened by okos.

comparision between the same variables

collection/collection_cmp.c:int col_compare_items

 83        switch(mode) {
 84
 85        case COL_CMPIN_PROP_EQU: /* looking for exact match */
 86
 87            /* Compare hashes and lengths first */
CID 10041 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)same_on_both_sides: "first->phash == first->phash" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical first operand of '&&'.
 88            if ((first->phash == first->phash) &&
 89                (first->property_len == second->property_len)) {
 90                /* Collections are case insensitive, sorry... */
 91                cmpres = strncasecmp(first->property,
 92                                     second->property,
 93                                     second->property_len);

Fields changed

description: comparision between the same variables

{{{
83 switch(mode) {
84
85 case COL_CMPIN_PROP_EQU: / looking for exact match /
86
87 / Compare hashes and lengths first /

CID 10041 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)same_on_both_sides: "first->phash == first->phash" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical first operand of '&&'.
88 if ((first->phash == first->phash) &&
89 (first->property_len == second->property_len)) {
90 / Collections are case insensitive, sorry... /
91 cmpres = strncasecmp(first->property,
92 second->property,
93 second->property_len);
}}}
=> comparision between the same variables

collection/collection_cmp.c:int col_compare_items
{{{
83 switch(mode) {
84
85 case COL_CMPIN_PROP_EQU: / looking for exact match /
86
87 / Compare hashes and lengths first /

CID 10041 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)same_on_both_sides: "first->phash == first->phash" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical first operand of '&&'.
88 if ((first->phash == first->phash) &&
89 (first->property_len == second->property_len)) {
90 / Collections are case insensitive, sorry... /
91 cmpres = strncasecmp(first->property,
92 second->property,
93 second->property_len);
}}}

summary: comparision has no effect => ding-libs.collection: comparision has no effect

Fields changed

patch: 0 => 1

Fields changed

milestone: NEEDS_TRIAGE => Tools 1.0.1

Fields changed

rhbz: => 0

Fields changed

owner: somebody => okos

resolution: => fixed
status: new => closed
_comment0: * master: bba9bb80671636886206f74549705329c42e4bcc => 1365609469798082

Metadata Update from @okos:
- Issue assigned to okos
- Issue set to the milestone: Tools 1.0.1

Metadata