From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: master d3d60ab: Remove unnecessary dependency on seq library Date: Mon, 04 Jan 2021 02:24:51 +0000 Message-ID: <87sg7hbfrg.fsf@tcd.ie> References: <20210103220053.27764.38848@vcs0.savannah.gnu.org> <20210103220055.5BBC120999@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25029"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Mark Oteiza Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 04 03:26:27 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kwFZj-0006R4-OT for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Jan 2021 03:26:27 +0100 Original-Received: from localhost ([::1]:57204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwFZi-0000GS-Qv for ged-emacs-devel@m.gmane-mx.org; Sun, 03 Jan 2021 21:26:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwFYL-0008AS-Ah for emacs-devel@gnu.org; Sun, 03 Jan 2021 21:25:01 -0500 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:37846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwFYI-0001eO-5A for emacs-devel@gnu.org; Sun, 03 Jan 2021 21:25:01 -0500 Original-Received: by mail-wr1-x434.google.com with SMTP id i9so30735591wrc.4 for ; Sun, 03 Jan 2021 18:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WOSZNVpAVQoZEKXZ6pRYirskhUBXmJUa7iV9AbqSOm4=; b=FDIndblFdIa8so+UGMaRQyfO9lGISgiCFjhexH0qk0TvGSUzCyX+95irhuY3EOJn4+ wnF3txecpR0lFp+hEHnoUcpj6QdHLL+uHFaVD7a4XCXui5lWL5PgbjpK56iMBDGMoz6Q rx5v31fMKUNX9h6QJlgA/2NCcbOO2w13YHnybRMXaX+X0TJ4Lctt0fk6KCee5R/gBX9x XA+ZzAVQlnK2cjdsBuYnD3bKPEe2UL0vlao0PKweGsiK3eb5xu2Oxm8qsV3h9GHOgMqF GNdGHRgv2kL7c6X0Soji8LYustvSxGQT7doYxRZOIH7oRtbEV1x7Bf6TaNsr480xnN3g WHuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WOSZNVpAVQoZEKXZ6pRYirskhUBXmJUa7iV9AbqSOm4=; b=eO/4RKLXaWmfsHT/6NyMVxR30wWqEHXIH7CbfFuTkEuOCYybvvLjwUNiC4ctZEC1wl rf1NV1/a8b5gr8r1QnnU7KBf9taO/cfO6vGFpYHdP1754p42PtLZzcdIoDKfB2q54GvD hPeonW+G50R0RPozHb7bMBKh9Ht8iZvfuDANfyZJkHxsuqbYd/TYDBffJ0DWCKb52CXE NdTgHkmhJ3U0ewFIsCv1Ih1H1ifvAONoy9xrvFGvmhgik6cegiCkuAqMtKD7Z/3L0qhv RFK1XJr+wrvYXHUd4Ry+xt471a4LUuS9l/RKdGqCsY4gaucFyOjxSC/3GnqQxNemz7A+ wh8A== X-Gm-Message-State: AOAM532EIBgukLfAsRRtMT7nULq7lSKwMRMCCYxl5S6FNWMsZ3Z8LQWb p4SREDRjx3RC/y4DqINNPi9zQg== X-Google-Smtp-Source: ABdhPJxs3avqoou49stEG+HkywR5ilH91zfDnmorVRa4q9JVrfebnCL5Gu1CkORJDc2o4USqCugJwg== X-Received: by 2002:adf:c642:: with SMTP id u2mr67380170wrg.243.1609727093465; Sun, 03 Jan 2021 18:24:53 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id e15sm88425092wrx.86.2021.01.03.18.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 18:24:52 -0800 (PST) In-Reply-To: <20210103220055.5BBC120999@vcs0.savannah.gnu.org> (Mark Oteiza's message of "Sun, 3 Jan 2021 17:00:54 -0500 (EST)") Received-SPF: none client-ip=2a00:1450:4864:20::434; envelope-from=contovob@tcd.ie; helo=mail-wr1-x434.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:262387 Archived-At: mvoteiza@udel.edu (Mark Oteiza) writes: > branch: master > commit d3d60ab2723fe4b3fa15f4d593319d0d08892cb0 > Author: Mark Oteiza > Commit: Mark Oteiza > > 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