From nobody Sat Jul 5 16:18:07 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521528615432192.48118117498018; Mon, 19 Mar 2018 23:50:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B077E4E8B8; Tue, 20 Mar 2018 06:50:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7EA5E61353; Tue, 20 Mar 2018 06:50:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2C42D180BADA; Tue, 20 Mar 2018 06:50:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6njjw019499 for ; Tue, 20 Mar 2018 02:49:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1D0BAC5DA7; Tue, 20 Mar 2018 06:49:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15F5A5C545 for ; Tue, 20 Mar 2018 06:49:45 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 235314E8B8 for ; Tue, 20 Mar 2018 06:49:44 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id f14so456695wre.8 for ; Mon, 19 Mar 2018 23:49:44 -0700 (PDT) Received: from rst.Home ([2a02:c7d:692a:c500:1ebc:73f3:5f60:b131]) by smtp.gmail.com with ESMTPSA id g38sm1923269wra.77.2018.03.19.23.49.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G9tw4Hw+WXWd+OxlPKiSZ5n8oFjcscQQgD32ewxSz88=; b=pNhvxmxTIWzah72Z5ccBXSKJrsyzhwJMZIW+SFQecXinFZ2GZoPBw13z+Syl1B1zEE eblfpm9KGQXtk5huKKYAGLRF3wZXFoFDNc6m56WougJM9JoYWPjzDBrIsJUl94pCYvcB 7vwhC6rV+XMRMmY7bMK+ztnrwfGpw9LhBwIRIfyvBgZpV5Vd3p6UhmTjmwIJDbjSQj7l zBz6YaWssv9RoFETEJo3BF/E9SkeIdxrT0D1Jg5g5qh8K6yn51Iv1Ih8rib3hvBBpaFI vMSdDIF2g/fy+Yzg/KOyE1/A1P34uwJHbn86dgVxtz1ObjeXzXzr05LxC0QEvW75Ze8R akzA== 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:date:message-id:in-reply-to :references; bh=G9tw4Hw+WXWd+OxlPKiSZ5n8oFjcscQQgD32ewxSz88=; b=dv80YresNzNbIpZQpsNZgCPPmyKVTC7dA0A8ECcqOuYqbnkXGXBaQ8djvOHYTyDF+B ZAkpocH74V14ywy/QiLt9DwmimwCUeKVN0ybblFCyQSS1Xp1Iqjpxi3C93RkeVv3rSpT xlTGl9+4NHOES+53gUaWsUY2kELSbZTjr1SuJWEk5kEfyDlApprK9e90xjRsA1rpuw6M 9egunjwxC4iZx1y6B4wSehgILsWKN8RPw5hTR48ZJ4bmzN4OIvmfq81ibMYJqpe6geyc 9Pt+oc1fZct3H4I9eLg7wP64FdrFBGu7ESgauCD84vy7KnEBvvcwh61Wrvb59c3IXfht 1Xlw== X-Gm-Message-State: AElRT7FvIzxi5ani4kMleIgnRPpDgxdFBB2WD14QF4TrQRQHHMx0HChh HQWdPoqs9+i7qSGLpQV+a2NheS7Q X-Google-Smtp-Source: AG47ELtywJAslNnJMLGblQqyfacrWNo+JwjazsmfdrTdpmrVjnewjAB7Za75tmFhJHuZv6tFBoIZnQ== X-Received: by 10.223.174.2 with SMTP id x2mr12513587wrc.211.1521528582528; Mon, 19 Mar 2018 23:49:42 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:57 +0000 Message-Id: <20180320064908.17723-15-rstoyanov1@gmail.com> In-Reply-To: <20180320064908.17723-1-rstoyanov1@gmail.com> References: <20180320064908.17723-1-rstoyanov1@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:49:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:49:44 +0000 (UTC) for IP:'209.85.128.196' DOMAIN:'mail-wr0-f196.google.com' HELO:'mail-wr0-f196.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.196 mail-wr0-f196.google.com 209.85.128.196 mail-wr0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 14/25] apibuild: Avoid double sorting of ids X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Mar 2018 06:50:14 +0000 (UTC) X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The uniq() function returns a sorted list, there is no need to sort this list again. Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 1619c8836..e5e4bc83d 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -2318,8 +2318,7 @@ class docBuilder: if desc.find("DEPRECATED") !=3D -1: output.write(" \n") =20 - ids =3D sorted(dict.macros.keys()) - for id in uniq(ids): + for id in uniq(dict.macros.keys()): # Macros are sometime used to masquerade other types. if id in dict.functions: continue @@ -2334,20 +2333,15 @@ class docBuilder: if id in dict.enums: continue output.write(" \n" = % (id)) - ids =3D sorted(dict.enums.keys()) - for id in uniq(ids): + for id in uniq(dict.enums.keys()): output.write(" \n" %= (id)) - ids =3D sorted(dict.typedefs.keys()) - for id in uniq(ids): + for id in uniq(dict.typedefs.keys()): output.write(" \n= " % (id)) - ids =3D sorted(dict.structs.keys()) - for id in uniq(ids): + for id in uniq(dict.structs.keys()): output.write(" \n"= % (id)) - ids =3D sorted(dict.variables.keys()) - for id in uniq(ids): + for id in uniq(dict.variables.keys()): output.write(" \= n" % (id)) - ids =3D sorted(dict.functions.keys()) - for id in uniq(ids): + for id in uniq(dict.functions.keys()): output.write(" \= n" % (id)) output.write(" \n") =20 @@ -2363,7 +2357,6 @@ class docBuilder: list(dict.typedefs.keys()) + \ list(dict.structs.keys()) + \ list(dict.enums.keys())) - ids.sort() for id in ids: output.write(" \n" % (id)) output.write(" \n") --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list