Re: [PATCH] lib/string_map: simulate stable sorting

Subject: Re: [PATCH] lib/string_map: simulate stable sorting

Date: Tue, 28 Nov 2023 09:24:56 -0400

To: Tomi Ollila,


From: David Bremner

Tomi Ollila <> writes:

> On Sat, Nov 25 2023, David Bremner wrote:
>> qsort(3) does not promise stability, and recent versions of glibc have
>> been showing more unstable behaviour [2]. Michael Gruber observed [1] test
>> breakage due to changing output order for message properties.
>> We provide a sorting order of (key,value) pairs that _looks_ stable by
>> breaking ties based on value if keys are equal. Internally there may
>> be some instability in the case of duplicate (key,value) pairs, but it
>> should not be observable via the iterator API.
> I don't know (from the visible context here) why this is needed, but I
> can image it is useful, so
> Tomi

Applied to release and master.

notmuch mailing list --
To unsubscribe send an email to