From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by sourceware.org (Postfix) with ESMTPS id BA38838133FC for ; Tue, 7 Jun 2022 15:23:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA38838133FC Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org Received: (Authenticated sender: dodji@seketeli.org) by mail.gandi.net (Postfix) with ESMTPSA id AC3FD60004; Tue, 7 Jun 2022 15:23:39 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id C75655800FC; Tue, 7 Jun 2022 17:23:38 +0200 (CEST) From: Dodji Seketeli To: Ben Woodard via Libabigail Subject: Re: [PATCH] Remove redundant code from abidiff Organization: Me, myself and I References: <20220603131621.315455-1-woodard@redhat.com> X-Operating-System: Fedora 37 X-URL: http://www.seketeli.net/~dodji Date: Tue, 07 Jun 2022 17:23:38 +0200 In-Reply-To: <20220603131621.315455-1-woodard@redhat.com> (Ben Woodard via Libabigail's message of "Fri, 3 Jun 2022 06:16:21 -0700") Message-ID: <871qw0mr9h.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2022 15:23:43 -0000 Ben Woodard via Libabigail a =C3=A9crit: > While working on abicompat, I noticed that the following two blocks of > code are redundant. They perform the same test as in the switch > statement a few lines below. > > * tools/abidiff.cc - remove redundant code. Thanks! I have applied the patch to the master branch. I have just updated the ChangeLog part of the log to make it comply with the standard. Below is the patch that was applied. >From ebf8f98f3dc7b6e4fe2af9c1ccbbfee55ace6c54 Mon Sep 17 00:00:00 2001 From: Ben Woodard Date: Fri, 3 Jun 2022 06:16:21 -0700 Subject: [PATCH] abidiff: Remove redundant code While working on abicompat, I noticed that the following two blocks of code are redundant. They perform the same test as in the switch statement a few lines below. * tools/abidiff.cc (main): Remove redundant code. Signed-off-by: Ben Woodard Signed-off-by: Dodji Seketeli --- tools/abidiff.cc | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tools/abidiff.cc b/tools/abidiff.cc index 37a273ad..e0f6d5be 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -1127,20 +1127,7 @@ main(int argc, char* argv[]) abigail::tools_utils::file_type t1_type, t2_type; =20 t1_type =3D guess_file_type(opts.file1); - if (t1_type =3D=3D abigail::tools_utils::FILE_TYPE_UNKNOWN) - { - emit_prefix(argv[0], cerr) - << "Unknown content type for file " << opts.file1 << "\n"; - return abigail::tools_utils::ABIDIFF_ERROR; - } - t2_type =3D guess_file_type(opts.file2); - if (t2_type =3D=3D abigail::tools_utils::FILE_TYPE_UNKNOWN) - { - emit_prefix(argv[0], cerr) - << "Unknown content type for file " << opts.file2 << "\n"; - return abigail::tools_utils::ABIDIFF_ERROR; - } =20 environment_sptr env(new environment); #ifdef WITH_DEBUG_SELF_COMPARISON --=20 2.36.1 Cheers, --=20 Dodji