This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Make completions almost instantaneous
- To: Daniel Berlin <dberlin at redhat dot com>
- Subject: Re: [PATCH] Make completions almost instantaneous
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 30 Mar 2001 18:50:14 -0500
- Cc: gdb-patches at sources dot redhat dot com
- References: <Pine.LNX.4.33.0103300144290.20894-100000@www.cgsoftware.com>
Daniel Berlin wrote:
> - /* Clip any symbol names that we've already considered. (This is a
> - time optimization) */
> -
> - for (i = 0; i < return_val_index; ++i)
> - {
> - if (STREQ (symname, return_val[i]))
> - {
> - return;
> - }
> - }
> -
It probably should have said ``space optimization''. I'd take a guess
that this dates back to a time when readline didn't remove duplicates
and when people were more worried about memory.
I suspect that someone might eventually re-tweek the code so that it
does an O(log(n)) sorted insertion and that way eliminates duplicates.
However, given that Eli (i.e. dos) is happy with change, I don't see
that happening soon.
As Elena said, nice catch.
Andrew