From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Daniel Berlin Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Make completions almost instantaneous Date: Fri, 30 Mar 2001 15:50:00 -0000 Message-id: <3AC51BB6.93AF768B@cygnus.com> References: X-SW-Source: 2001-03/msg00570.html 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