all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Mark Oteiza <mvoteiza@udel.edu>
Cc: emacs-devel@gnu.org
Subject: Re: master d3d60ab: Remove unnecessary dependency on seq library
Date: Mon, 04 Jan 2021 02:24:51 +0000	[thread overview]
Message-ID: <87sg7hbfrg.fsf@tcd.ie> (raw)
In-Reply-To: <20210103220055.5BBC120999@vcs0.savannah.gnu.org> (Mark Oteiza's message of "Sun, 3 Jan 2021 17:00:54 -0500 (EST)")

mvoteiza@udel.edu (Mark Oteiza) writes:

> branch: master
> commit d3d60ab2723fe4b3fa15f4d593319d0d08892cb0
> Author: Mark Oteiza <mvoteiza@udel.edu>
> Commit: Mark Oteiza <mvoteiza@udel.edu>
>
>     Remove unnecessary dependency on seq library
>     
>     * lisp/json.el: Remove require declaration.
>     (json-encode-array): Just use length and /=.
> ---
>  lisp/json.el | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lisp/json.el b/lisp/json.el
> index f5659d8..2498659 100644
> --- a/lisp/json.el
> +++ b/lisp/json.el
> @@ -55,7 +55,6 @@
>  ;;; Code:
>  
>  (require 'map)
> -(require 'seq)
>  (require 'subr-x)
>  
>  ;; Parameters
> @@ -655,7 +654,7 @@ become JSON objects."
>  (defun json-encode-array (array)
>    "Return a JSON representation of ARRAY."
>    (if (and json-encoding-pretty-print
> -           (not (seq-empty-p array)))
> +           (/= 0 (length array)))

The reason for seq-empty-p was that it doesn't traverse the entire
length of lists.  Please keep this optimisation, e.g. via:

  (if (listp array)
      array
    (> (length array) 0))

Thanks,

-- 
Basil



       reply	other threads:[~2021-01-04  2:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210103220053.27764.38848@vcs0.savannah.gnu.org>
     [not found] ` <20210103220055.5BBC120999@vcs0.savannah.gnu.org>
2021-01-04  2:24   ` Basil L. Contovounesios [this message]
2021-01-04  3:09     ` master d3d60ab: Remove unnecessary dependency on seq library Mark Oteiza

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

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

  git send-email \
    --in-reply-to=87sg7hbfrg.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=mvoteiza@udel.edu \
    /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 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.