On Mon, Dec 01, 2014 at 03:24:20PM +0100, Dag-Erling Smørgrav wrote:
> Adrian Chadd <adr...@freebsd.org> writes:
> > Dag-Erling Smørgrav <d...@des.no> writes:
> > > I added code to cmd_register() in ifconfig.c to warn about duplicate
> > > commands.  [...]
> > Would you mind committing that code, so we at least get warned about
> > it when we try?
> 
> It's quadratic and runs every time a set of commands is added, which
> means the total running time is closer to n! than n^2.  I can add it
> with an #ifdef, but that's not very useful.  It would be better to
> rewrite ifconfig to use a hash table instead of a linked list.

Can't you use a simple bloom filter to cover 99% of the cases and just
fallback to a simple search on match?

Joerg
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to