hal: Branch 'master'
Danny Kukawka
danny.kukawka at web.de
Wed Oct 11 01:03:43 PDT 2006
On Wednesday 11 October 2006 06:43, David Zeuthen wrote:
> @@ -948,22 +948,14 @@ ids_comp_pnp(const void *id1, const void
> void
> ids_find_pnp (const char *pnp_id, char **pnp_description)
> {
> - static gboolean sorted = FALSE;
> struct pnp_id search, *res;
> -
> - if (!sorted) {
> - /* sort the list, to be sure that all is in correc order */
> - qsort(pnp_ids_list, sizeof(pnp_ids_list)/sizeof(pnp_ids_list[0]),
> - sizeof(struct pnp_id), ids_comp_pnp);
> - sorted = TRUE;
> - }
I'm not sure if it's a really good idea to remove this code part. If there is
only on element not in the correct order in the list the complete bsearch can
fail and we get never the correct description. IMO the win of the patch is
nothing against the risk. Maybe it's enough to make the members of the struct
const, but not the struct itself.
Danny
More information about the hal-commit
mailing list