emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 605f901: Prefer memcpy and memset to doing it b


From: Stefan Monnier
Subject: Re: [Emacs-diffs] master 605f901: Prefer memcpy and memset to doing it by hand
Date: Fri, 05 Feb 2016 08:25:11 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> +  if (XLI (init) == 0)
> +    memset (p->contents, 0, XFASTINT (length) * sizeof p->contents[0]);
> +  else
> +    for (ptrdiff_t i = 0; i < XFASTINT (length); i++)
> +      p->contents[i] = init;

FWIW, I much prefer keeping just the loop, over using this "if+memset"
which seems like an obvious case or too-early-optimization.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]