Explorar o código

Bug 622903 - fix coverity Defect Type: Code maintainability issues

https://bugzilla.redhat.com/show_bug.cgi?id=622903

Comment:
The "p" assignments on line 260, 264, and 268 can be removed
because they are not needed.
Noriko Hosoi %!s(int64=15) %!d(string=hai) anos
pai
achega
3ec3639a80
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      ldap/servers/slapd/back-ldbm/ldbm_attr.c

+ 3 - 4
ldap/servers/slapd/back-ldbm/ldbm_attr.c

@@ -183,7 +183,6 @@ attr_index_config(
 	char	**index_rules = NULL;
 	char	**index_rules = NULL;
 	struct attrinfo	*a;
 	struct attrinfo	*a;
 	int return_value = -1;
 	int return_value = -1;
-	char    *p;
 	int *substrlens = NULL;
 	int *substrlens = NULL;
 
 
 	attrs = slapi_str2charray( argv[0], "," );
 	attrs = slapi_str2charray( argv[0], "," );
@@ -272,15 +271,15 @@ attr_index_config(
 					Slapi_PBlock* pb = NULL;
 					Slapi_PBlock* pb = NULL;
 					int do_continue = 0; /* can we skip the RULE parsing stuff? */
 					int do_continue = 0; /* can we skip the RULE parsing stuff? */
 
 
-					if ((p = strstr(index_rules[j], INDEX_ATTR_SUBSTRBEGIN))) {
+					if (strstr(index_rules[j], INDEX_ATTR_SUBSTRBEGIN)) {
 						_set_attr_substrlen(INDEX_SUBSTRBEGIN, index_rules[j],
 						_set_attr_substrlen(INDEX_SUBSTRBEGIN, index_rules[j],
 											&substrlens);
 											&substrlens);
 						do_continue = 1; /* done with j - next j */
 						do_continue = 1; /* done with j - next j */
-					} else if ((p = strstr(index_rules[j], INDEX_ATTR_SUBSTRMIDDLE))) {
+					} else if (strstr(index_rules[j], INDEX_ATTR_SUBSTRMIDDLE)) {
 						_set_attr_substrlen(INDEX_SUBSTRMIDDLE, index_rules[j],
 						_set_attr_substrlen(INDEX_SUBSTRMIDDLE, index_rules[j],
 											&substrlens);
 											&substrlens);
 						do_continue = 1; /* done with j - next j */
 						do_continue = 1; /* done with j - next j */
-					} else if ((p = strstr(index_rules[j], INDEX_ATTR_SUBSTREND))) {
+					} else if (strstr(index_rules[j], INDEX_ATTR_SUBSTREND)) {
 						_set_attr_substrlen(INDEX_SUBSTREND, index_rules[j],
 						_set_attr_substrlen(INDEX_SUBSTREND, index_rules[j],
 											&substrlens);
 											&substrlens);
 						do_continue = 1; /* done with j - next j */
 						do_continue = 1; /* done with j - next j */