Eric MSP Veith escribió:
> Hello list,
>
> while trying to solve my problem, I sufred through the source code and found
> the named function, which I will paste for reference:
>
> - -----
> active_db_h *initng_active_db_find_by_name(const char *service)
> {
> assert(service);
> active_db_h *current = NULL;
>
> D_("(%s);\n", (char *) service);
>
> /* first give the exact find a shot */
> if ((current = initng_active_db_find_by_exact_name(service)))
> return (current);
>
>
> /* did not find any */
> return NULL;
>
> /* no need in pattern matching, because of unique names in cache
> (TheLich)
> */
>
> /* walk the active db and compere */
> current = NULL;
> while_active_db(current)
> {
> assert(current->name);
> /* then try to find alike name */
> if (service_match(current->name, service))
> return (current);
>
> }
> }
> - -----
>
> What is not clear to me is TheLich's comment and the code that follows
> thereafter. Doesn't the "return NULL;" above make it redundant? Why was the
> while loop left there?
That's because of the find plugin, the code after the comment isn't
needed anymore. But I don't know why it was left there.
--
_______________________________________________
Initng mailing list
[email protected]
http://jw.dyndns.org/mailman/listinfo/initng