From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11416 invoked by alias); 10 May 2015 00:29:12 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35070 Received: (qmail 18597 invoked from network); 10 May 2015 00:29:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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== MIME-Version: 1.0 X-Received: by 10.107.163.79 with SMTP id m76mr5515610ioe.85.1431217736927; Sat, 09 May 2015 17:28:56 -0700 (PDT) In-Reply-To: <150509171446.ZM15357@torch.brasslantern.com> References: <150509171446.ZM15357@torch.brasslantern.com> Date: Sun, 10 May 2015 02:28:56 +0200 Message-ID: Subject: Re: PATCH: Don't treat NUL as a combining character From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Sun, May 10, 2015 at 2:14 AM, Bart Schaefer 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