Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Don't treat NUL as a combining character
- X-seq: zsh-workers 35070
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: Don't treat NUL as a combining character
- Date: Sun, 10 May 2015 02:28:56 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DDMXUcB/O/jHuneCA1VPh/qPm2wbcKBxivY3yvpxbdo=; b=FkscZb12sSg/E/1NKXV1RUjcIhPlAfSrxRwyu9R3y2ywLuz0F4v3M0me5k3z6RciK5 nOMiTJbyIL7Wqw3dvrwdFvrNjpsa8U9ELwNvf28rhhngmaJ+k4U7n/i6wgwf3LupXZfh K8MEbEAZfurqwaHy0BRlEurlBES5Z86ndLjV8Lf/vvKkZlU9IsIKwdhntOXsciScTcai rF/hAaC+u95widNq6YM9ut/IXYx+udOH2csAw1u9e1yyKMM9LsVAIWkz6Hszx66LJJi+ g0Cvxi/3JZ8Uq5/xjXgwLPtV6VZh0yXiHxNsmSyfR5qknCzs9yADEU+NCcuJSVfDLSyy CDbA==
- In-reply-to: <150509171446.ZM15357@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHYJk3RZVupQ4EZyqAioWOYToas3bPYH=XxPQNbfA4KErUOc=Q@mail.gmail.com> <CAHYJk3QkgtwWxMxzpcGHAWBCS+c8fSgBmE0LQ7jnS+-prx8+Nw@mail.gmail.com> <150509171446.ZM15357@torch.brasslantern.com>
On Sun, May 10, 2015 at 2:14 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On May 10, 2:02am, Mikael Magnusson wrote:
> } Subject: Re: PATCH: Don't treat NUL as a combining character
> }
> } > -#define IS_COMBINING(wc) (WCWIDTH(wc) == 0 && !iswcntrl(wc))
> } > +#define IS_COMBINING(wc) (wc != 0 && WCWIDTH(wc) == 0 && !iswcntrl(wc))
> }
> } Instead of making this path ever so slightly slower by adding an extra
> } test that only matters a fraction of the time
>
> I think the test would be no slower (or at least faster than what you have
> there) if you just put the wc != 0 as the last branch of the && chain?
>
> } could we actually make it wc > 127 instead?
>
> I don't know the definitive answer to that, but it seems it should also go
> at the end. We're really micro-optimizing here, though.
That's a good point, I put it first because checking value is much
faster than calling a function, but NUL is super rare which I didn't
consider at the time.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author