Commit 8fae314b authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Code cleanup.

* src/server/aux-items.c (aux_item_check_unique): Removed bogus
code that find_aux_item_definitions to be needlessly called.
Force the caller to supply the definition, as all callers already
do.
parent 146944b2
2006-08-01 Per Cederqvist <ceder@lysator.liu.se> 2006-08-01 Per Cederqvist <ceder@lysator.liu.se>
Code cleanup.
* src/server/aux-items.c (aux_item_check_unique): Removed bogus
code that find_aux_item_definitions to be needlessly called.
Force the caller to supply the definition, as all callers already
do.
Removed code with no effect. (Bug 142). Removed code with no effect. (Bug 142).
* src/server/aux-items.c (aux_item_link_items): Removed assignment * src/server/aux-items.c (aux_item_link_items): Removed assignment
to a local variable that is not used after the assignment. to a local variable that is not used after the assignment.
......
...@@ -192,7 +192,7 @@ static Aux_item_definition simple_aux_item = ...@@ -192,7 +192,7 @@ static Aux_item_definition simple_aux_item =
static Bool static Bool
aux_item_check_unique(const Aux_item *item, aux_item_check_unique(const Aux_item *item,
const Aux_item_definition *xdef, const Aux_item_definition *def,
Aux_item_list *add_to_list, Aux_item_list *add_to_list,
unsigned long start_looking_at); unsigned long start_looking_at);
...@@ -1157,6 +1157,8 @@ aux_item_check_unique(const Aux_item *item, ...@@ -1157,6 +1157,8 @@ aux_item_check_unique(const Aux_item *item,
{ {
unsigned long i; unsigned long i;
assert(def != NULL);
if (add_to_list == NULL if (add_to_list == NULL
|| item == NULL || item == NULL
|| start_looking_at >= add_to_list->length) || start_looking_at >= add_to_list->length)
...@@ -1164,11 +1166,6 @@ aux_item_check_unique(const Aux_item *item, ...@@ -1164,11 +1166,6 @@ aux_item_check_unique(const Aux_item *item,
return TRUE; return TRUE;
} }
if (def != NULL)
def = find_aux_item_definition(item);
if (def == NULL)
return TRUE;
for (i = start_looking_at; i < add_to_list->length; i++) for (i = start_looking_at; i < add_to_list->length; i++)
{ {
if (def->one_per_person if (def->one_per_person
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment