On Friday 20 November 2009, Zach Welch wrote:
> On Fri, 2009-11-20 at 13:08 -0700, David Brownell wrote:
> > On Friday 20 November 2009, Zachary T Welch wrote:
> > > Use insertion sort to the command link lists.  The only practical effect
> > > of this is to order the output of the new 'help' command.
> > 
> > O(really)?  O(n) != O(1).  ;)
> > 
> > Not that it can matter so long as we have sane numbers
> > of commands.
> 
> Heh, almost a great point except it already used an O(n) algorithm, as
> it was appending to the end of the list prior to this change.

Didn't realize it was *that* stupid ... it should have been
sticking it at the beginning of the list, if it wasn't
going to be maintaining any sane order!!  :)



> Now, we 
> also do a strcmp at each step and then decide to pre- or post- append.
> Since it's at registration time, any extra cost will be almost moot.

As I said:  so long as we have sane numbers of commands.




_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to