1 Star 0 Fork 29

openeuler_bot/iputils

forked from src-openEuler/iputils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-tracepath-Merge-if-clauses.patch 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
肖在 提交于 2024-05-16 14:22 . merge if clauses in tracepath
From 608c62b3967882d31ff9edde97e38de0fcff154b Mon Sep 17 00:00:00 2001
From: Petr Vorel <[email protected]>
Date: Wed, 24 May 2023 10:40:23 +0200
Subject: [PATCH 018/135] tracepath: Merge if clauses
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Merge if clauses, because the printed message is the same.
This should have been done in 3337034 ("Initial import of iputils"),
but 2ca0f7d made it even worse when remove else from else if
(clang-tidy was obviously wrong :)).
Fixes: 2ca0f7d ("[clang-tidy] fix identical branches")
Reviewed-by: Marek Küthe <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
Reference: https://github.com/iputils/iputils/commit/608c62b3967882d31ff9edde97e38de0fcff154b
---
tracepath.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tracepath.c b/tracepath.c
index ebb7f72..04d77b8 100644
--- a/tracepath.c
+++ b/tracepath.c
@@ -321,10 +321,8 @@ static int recverr(struct run_state *const ctl)
e->ee_type == ICMPV6_TIME_EXCEED &&
e->ee_code == ICMPV6_EXC_HOPLIMIT)) {
if (rethops >= 0) {
- if (sndhops >= 0 && rethops != sndhops)
- printf(_("asymm %2d "), rethops);
-
- if (sndhops < 0 && rethops != ctl->ttl)
+ if ((sndhops >= 0 && rethops != sndhops) ||
+ (sndhops < 0 && rethops != ctl->ttl))
printf(_("asymm %2d "), rethops);
}
printf("\n");
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeulerbot/iputils.git
[email protected]:openeulerbot/iputils.git
openeulerbot
iputils
iputils
master

搜索帮助