From patchwork Tue Sep 5 11:08:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 137509 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp1608861vqo; Tue, 5 Sep 2023 04:16:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWwYEULQcwoAR7OEJ0Xe1Jd9yOXDT8MWguYjfHVHCDUj8f9MJfDmhbGEci4ap58MsrAuqn X-Received: by 2002:a17:906:1054:b0:9a5:b95a:1179 with SMTP id j20-20020a170906105400b009a5b95a1179mr8065891ejj.77.1693912597635; Tue, 05 Sep 2023 04:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693912597; cv=none; d=google.com; s=arc-20160816; b=i1sIKL1PwCzvkypEDr489W1Ec5SaMKE1HELBSEZlbb0+jsBV35fhfNg3Vh7a8bS+v6 T2dXK9vSAOXMeWMggImwNHz0ES4KkJL1ZqFeJu0A3w2uxtbf6y/gtabqU9UqJ4yQJiDY yi+lRoMJmLKF5+7GDJz5Y38W3w1n1h12p2/68JLSXYP7BYhs8sRhNTCk9YTcVBUuW1XQ +kaJbRvsOUL/1WyzTiTTy+JLfTsftWHy2MQaPnUBUOFaizMPqbMZYTdnZRtz2U5/hx85 WgefNfwHDajfA7K3P/PTfSIWfdZh5aCETrPecbrZbqjH/gO1X1OwCvw1Lprq6TRShw4a V1sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=3KFw5w026lcWPuEhZOM7wHDbSfI0csrCjZvTwOU7ALE=; fh=QRb7QY4BZ0mIIAPiH2G4K0PcYKRtRn2i5A6VLUA8cN4=; b=0tm3EO552/d323JqxPUsBRemahce3uss4gAJrCByeu6Fb0NDdGURMlLmrnTMlvasuo iVHQUE6KwwUKMsMHnBZj2rIT8OUoiVmykOJgdig6SXceI05+qeTHxrWma9u1WTyY5UgU fZybmhKcnmuD5hl6LZNJd+34EenMNmP/5CaXYL35x0HXdOE0HNsYHT3L8bgML6Ph/8Np WyWNSqCbZIQTww5NDKaN18hocgLm/dweg4d0gbxtkws4O6Lnispus/MXGhz6Ceo9yYZZ yQFPs3yWJfJY9gZkE1g39pbSoXq++HBimEY4/FTJLsPv4RZmaS25nTG8TFM4I1hpWif3 YiMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KhJsqRhC; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ty21-20020a170907c71500b0099bca8453f0si7059958ejc.764.2023.09.05.04.16.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Sep 2023 04:16:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KhJsqRhC; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0265739484AA for ; Tue, 5 Sep 2023 11:11:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0265739484AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693912281; bh=3KFw5w026lcWPuEhZOM7wHDbSfI0csrCjZvTwOU7ALE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=KhJsqRhCcLMsBWG7tswPRo2cGU6GGXC5ECyJctPATyImyjHSn0uR1V7MK1CajA0p/ h63FYJp4K0+PiAesyynx41my9Lb8EnfVVvjsihWnrYGR3IjPYVORRcTaFNa3mY5fKC Eg1m/El/i9WNRHuuz+iAKbUMV+vmzQ6Y5j4yx1gY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 92D3C3857838 for ; Tue, 5 Sep 2023 11:08:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 92D3C3857838 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-401b0d97850so25091425e9.2 for ; Tue, 05 Sep 2023 04:08:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693912113; x=1694516913; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3KFw5w026lcWPuEhZOM7wHDbSfI0csrCjZvTwOU7ALE=; b=WIhO64gpFtXkKkxV02EoAF6Rq7hjOEBzo6wtEPbYknf38YHBP72K8xMhFjCzR0CtrI 4hGvMvuxCYNFDdz4zkBiecFaOcFWki2/L5rRKibw8XRp0dU2t6BoSb6Yf4Pf+VnoOsYV 59+v4YINOGbaciTCGWM4fLHwbotLwTW2UUqkNn9hWeTJG0MWuPwp5oxD3DE1gjElnOot vNQBbOuD7C4kTdHNMVHD/XVjVWsq0tUG6YRefaSA+ELb6+hfmE1GMk2hSiMVvnJTCj7n vI9B1vAr6mQv+Vs+K7P8V8HsNWyYtnUguSNzUV/x8jk126VTIm/wIh1N6bVI+ksCwmZh hXdg== X-Gm-Message-State: AOJu0Yx8rW6u1Z+IUGzXWchw+TUDzZ64u/LeZSf0A7gn+6NLUKkhmhrM 1O8rk+PRbRDzAzpKvJSYKRoiL9GEkaDLXwjBBBqQ2A== X-Received: by 2002:a05:600c:220b:b0:3fe:5501:d284 with SMTP id z11-20020a05600c220b00b003fe5501d284mr8992358wml.11.1693912113402; Tue, 05 Sep 2023 04:08:33 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:20fc:79e4:455c:1075]) by smtp.gmail.com with ESMTPSA id s17-20020a7bc391000000b003fe24441e23sm16726616wmj.24.2023.09.05.04.08.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Sep 2023 04:08:32 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Remove redundant guard against an empty list of interfaces Date: Tue, 5 Sep 2023 13:08:32 +0200 Message-Id: <20230905110832.563364-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776196096012479282 X-GMAIL-MSGID: 1776196096012479282 From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * sem_type.adb (Iface_Present_In_Ancestor): Remove guard for empty list of interfaces; the following loop will work just fine without it. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_type.adb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index 00a64152df1..bbdcd5f24b8 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -2578,9 +2578,7 @@ package body Sem_Type is end if; loop - if Present (Interfaces (E)) - and then not Is_Empty_Elmt_List (Interfaces (E)) - then + if Present (Interfaces (E)) then Elmt := First_Elmt (Interfaces (E)); while Present (Elmt) loop AI := Node (Elmt);