unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@protonmail.com>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Hard-to-understand line in xfaces.c
Date: Mon, 22 Jul 2024 14:38:13 +0000	[thread overview]
Message-ID: <ghVHKVQCmTyhMMnhOYp6N3FssJS6JnTXgicv0tmEaeo5_qgvqoV8-kY_IRbylj6yRYVYvPU94PoKFBGeSInmHQnTrUsD-h3gDx_2hh9SuGQ=@protonmail.com> (raw)
In-Reply-To: <CADwFkmkA-FyVi3o9zN6Z=A4WEgUVRGQcEGauhaGoLth=6xoRLA@mail.gmail.com>

On Monday, July 22nd, 2024 at 14:20, Stefan Kangas <stefankangas@gmail.com> wrote:
> Could someone explain this line in xfaces.c:7184?
> 
> len -= 0 < len && name[len - 1] == '\n';
> 
> It seems rather mysterious to me; for example, does it actually do
> anything?

I'd rewrite it as

if (len > 0 && name[len - 1] == '\n')
  len--;

though I'd test it actually does the same thing first :-)

Pip



      parent reply	other threads:[~2024-07-22 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22 14:20 Hard-to-understand line in xfaces.c Stefan Kangas
2024-07-22 14:35 ` Andrea Corallo
2024-07-22 14:59   ` Eli Zaretskii
2024-07-22 15:55   ` Stefan Kangas
2024-07-22 14:38 ` Pip Cet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ghVHKVQCmTyhMMnhOYp6N3FssJS6JnTXgicv0tmEaeo5_qgvqoV8-kY_IRbylj6yRYVYvPU94PoKFBGeSInmHQnTrUsD-h3gDx_2hh9SuGQ=@protonmail.com' \
    --to=pipcet@protonmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).