Skip to content

Commit 6f93b82

Browse files
GongHeng2017deepin-bot[bot]
authored andcommitted
fix(partition): simplify redundant condition in chart drawing
Remove redundant `else if (m_sumValue >= 100)` condition check, simplify to `else` since the preceding `if` already covers the complementary case. 简化分区图表绘制中冗余的条件判断,将 else if 简化为 else。 Log: 简化分区图表绘制冗余条件 PMS: https://pms.uniontech.com/bug-view-354861.html Influence: 仅代码逻辑简化,不影响功能行为。
1 parent 18b5323 commit 6f93b82

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

application/widgets/customcontrol/partchartshowing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-only
44

@@ -269,7 +269,7 @@ void PartChartShowing::addPaint(QPainter *painter)
269269
}
270270
m_flag = 0;
271271
}
272-
} else if (m_sumValue >= 100) { //绘制最后一个分区当超过整个分区容量的时候以及选中状态
272+
} else { //绘制最后一个分区当超过整个分区容量的时候以及选中状态
273273
// qDebug() << "Sum value is 100 or more, handling last partition";
274274
// qDebug() << "sumvalue" << sumvalue;
275275
double width = ((m_partSize.at(m_partSize.size() - 2) / m_total)) * (paintRect.width() - RADIUS) - RIGHTSPACE;

0 commit comments

Comments
 (0)