Re: ordered string-list considered harmful, was Re: [PATCH v3] Allow aliases that include other aliases
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 6, 2018, 23:50 UTC
- Message-ID
- <20180906235033.GA100309@aiede.svl.corp.google.com>
- In-Reply-To
- <20180906192021.GB26575@sigill.intra.peff.net>
Hi,
Jeff King wrote:
> But what I think is harmful is a _sorted_ list, because of the > "accidentally quadratic" nature, and because it's easy to call its > functions on an unsorted list.
I agree --- in general, it tends to be better to build an unsorted string list and then sort it.
Once I've done so, what is your advice about getting fast lookups in the result? Should I build an auxiliary hashmap as well? Or is this an argument for the 'sorted' flag + BUG approach you already mentioned?
Whatever we do, I agree with your goal of getting rid of string_list_insert.
Thanks, Jonathan