* [PATCH] Remove redundant code from abidiff
@ 2022-06-03 13:16 Ben Woodard
2022-06-07 15:23 ` Dodji Seketeli
0 siblings, 1 reply; 2+ messages in thread
From: Ben Woodard @ 2022-06-03 13:16 UTC (permalink / raw)
To: libabigail
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.
Signed-off-by: Ben Woodard <woodard@redhat.com>
---
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;
t1_type = guess_file_type(opts.file1);
- if (t1_type == 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 = guess_file_type(opts.file2);
- if (t2_type == 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;
- }
environment_sptr env(new environment);
#ifdef WITH_DEBUG_SELF_COMPARISON
--
2.36.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Remove redundant code from abidiff
2022-06-03 13:16 [PATCH] Remove redundant code from abidiff Ben Woodard
@ 2022-06-07 15:23 ` Dodji Seketeli
0 siblings, 0 replies; 2+ messages in thread
From: Dodji Seketeli @ 2022-06-07 15:23 UTC (permalink / raw)
To: Ben Woodard via Libabigail
Ben Woodard via Libabigail <libabigail@sourceware.org> a écrit:
> 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 <woodard@redhat.com>
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 <woodard@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
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;
t1_type = guess_file_type(opts.file1);
- if (t1_type == 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 = guess_file_type(opts.file2);
- if (t2_type == 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;
- }
environment_sptr env(new environment);
#ifdef WITH_DEBUG_SELF_COMPARISON
--
2.36.1
Cheers,
--
Dodji
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-07 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 13:16 [PATCH] Remove redundant code from abidiff Ben Woodard
2022-06-07 15:23 ` Dodji Seketeli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).