remove useless look checking for duplicates

This commit is contained in:
Gustavo Sverzut Barbieri 2011-12-08 16:36:48 -02:00
parent 1433ba9ef5
commit 558b020704
1 changed files with 1 additions and 8 deletions

View File

@ -46,13 +46,6 @@ static int add_value(struct index_value **values,
const char *value, unsigned len, unsigned int priority) const char *value, unsigned len, unsigned int priority)
{ {
struct index_value *v; struct index_value *v;
int duplicate = 0;
/* report the presence of duplicate values */
for (v = *values; v; v = v->next) {
if (streq(v->value, value))
duplicate = 1;
}
/* find position to insert value */ /* find position to insert value */
while (*values && (*values)->priority < priority) while (*values && (*values)->priority < priority)
@ -68,7 +61,7 @@ static int add_value(struct index_value **values,
v->value[len] = '\0'; v->value[len] = '\0';
*values = v; *values = v;
return duplicate; return 0;
} }
static void read_error(void) static void read_error(void)