all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] feature/byte-switch 13eabbd: bytecode.c (exec_byte_code): Use h->count instead of HASH_TABLE_SIZE
       [not found] ` <20170209134357.C161E25FF6@vcs0.savannah.gnu.org>
@ 2017-02-09 13:58   ` Stefan Monnier
  2017-02-09 16:27     ` Vibhav Pant
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2017-02-09 13:58 UTC (permalink / raw)
  To: emacs-devel; +Cc: Vibhav Pant

> +#ifdef BYTE_CODE_SAFE
> +            /* Hash tables for switch are declared with :size set to exact
> +               number of cases, so this should always be true.  */
> +            eassert (HASH_TABLE_SIZE (h) == h->count);
> +#endif

This equality is not needed for safety, only for performance.
IOW you can drop the assert altogether and turn it into a comment.


        Stefan



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Emacs-diffs] feature/byte-switch 13eabbd: bytecode.c (exec_byte_code): Use h->count instead of HASH_TABLE_SIZE
  2017-02-09 13:58   ` [Emacs-diffs] feature/byte-switch 13eabbd: bytecode.c (exec_byte_code): Use h->count instead of HASH_TABLE_SIZE Stefan Monnier
@ 2017-02-09 16:27     ` Vibhav Pant
  0 siblings, 0 replies; 2+ messages in thread
From: Vibhav Pant @ 2017-02-09 16:27 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

On Thursday, February 9, 2017, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> > +#ifdef BYTE_CODE_SAFE
> > +            /* Hash tables for switch are declared with :size set to
> exact
> > +               number of cases, so this should always be true.  */
> > +            eassert (HASH_TABLE_SIZE (h) == h->count);
> > +#endif
>
> This equality is not needed for safety, only for performance.
> IOW you can drop the assert altogether and turn it into a comment.
>

Done, thanks.


-- 
Vibhav Pant
vibhavp@gmail.com

[-- Attachment #2: Type: text/html, Size: 847 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-09 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170209134357.2270.49861@vcs0.savannah.gnu.org>
     [not found] ` <20170209134357.C161E25FF6@vcs0.savannah.gnu.org>
2017-02-09 13:58   ` [Emacs-diffs] feature/byte-switch 13eabbd: bytecode.c (exec_byte_code): Use h->count instead of HASH_TABLE_SIZE Stefan Monnier
2017-02-09 16:27     ` Vibhav Pant

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.