[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [PATCH 1/5] kernelbase/locale: Implement sortkey generation on official tables
From: Fabian Maurer <dark.shadow4 () web ! de>
Date: 2020-04-30 19:15:22
Message-ID: 25618562.PuU73HZRMu () arch
[Download RAW message or body]
Hello Zebediah,
> Could be, though I'd warn that attempts to reduce duplication (e.g. by
> introducing complicated macros) can often make code much less readable.
Sure, but in this case it should be very well worth it.
> Okay, I'm not sure I'm reading this macro right, but this is all
> internal to diacritic weights, right? If I understand, final weights
> which are 1 or 0 get stripped from the end of the sortkey, right? I
> think you could easily handle that by stripping weights after adding all
> of the diacritics, e.g. to use my previous example code,
>
> if (!(flags & NORM_IGNORENONSPACE))
> {
> for (i = 0; i < srclen; ++i)
> used += get_diacritic_weights(src[i], dst + used, dstlen - used);
>
> while (dst[used - 1] < 2)
> used--;
> }
Generally, yes. But it not only affects diacritics. And one needs to keep in
mind that the separator is also a 0 and must not be removed.
But maybe here the duplication is worth it?
Regards,
Fabian Maurer
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic