Skip to content

Commit 0558110

Browse files
committed
refactor(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 122cbf2 commit 0558110

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

@@ -237,7 +237,7 @@ void PartChartShowing::addPaint(QPainter *painter)
237237
}
238238
m_flag = 0;
239239
}
240-
} else if (m_sumValue >= 100) { //绘制最后一个分区当超过整个分区容量的时候以及选中状态
240+
} else { //绘制最后一个分区当超过整个分区容量的时候以及选中状态
241241
// qDebug() << "sumvalue" << sumvalue;
242242
double width = ((m_partSize.at(m_partSize.size() - 2) / m_total)) * (paintRect.width() - RADIUS) - RIGHTSPACE;
243243
if (m_partSize.at(m_partSize.size() - 2) / m_total < 0.01) {

0 commit comments

Comments
 (0)