unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Vibhav Pant <vibhavp@gmail.com>
Subject: Re: [Emacs-diffs] feature/byte-switch a75d080: * src/bytecode.c: Refactor to follow GNU coding standards
Date: Sat, 11 Feb 2017 10:46:48 -0500	[thread overview]
Message-ID: <jwvh940spgv.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <20170211125134.80F4325FCF@vcs0.savannah.gnu.org> (Vibhav Pant's message of "Sat, 11 Feb 2017 07:51:34 -0500 (EST)")

> +                    if (BYTE_CODE_SAFE)
> +                      eassert (!NILP (HASH_HASH (h, i)));

Declaring that non-full hashtables are "dangerous" is rather annoying.
In this case, I think we can do better:

                 Lisp_Object hash_code
                   = make_number (h->test.hashfn (&h->test, v1));

this then lets us use EQ (hash_code, ...) instead of hash_code == XUINT
(...)  which not only correctly skips nil hashes but might even be ever
so slightly faster (both use == on the same size of integers, but the
former avoids the cost of XUINT).


        Stefan



       reply	other threads:[~2017-02-11 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170211125132.3738.13650@vcs0.savannah.gnu.org>
     [not found] ` <20170211125134.80F4325FCF@vcs0.savannah.gnu.org>
2017-02-11 15:46   ` Stefan Monnier [this message]
2017-02-11 18:13     ` [Emacs-diffs] feature/byte-switch a75d080: * src/bytecode.c: Refactor to follow GNU coding standards Vibhav Pant

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=jwvh940spgv.fsf-monnier+emacsdiffs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=vibhavp@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).