apply some code analyzer recommendations
This commit is contained in:
@@ -24,7 +24,7 @@ enum ColumnThreads {
|
||||
ThreadsModel::ThreadsModel() {
|
||||
PICodeInfo::EnumInfo * ei = PICODEINFO::enums().value("PIIntrospectionThreads::ThreadState");
|
||||
if (ei) {
|
||||
piForeachC(PICodeInfo::EnumeratorInfo & e, ei->members) {
|
||||
for (const auto & e: ei->members) {
|
||||
#if PIP_VERSION >= PIP_MAKE_VERSION(2, 39, 0)
|
||||
state_names[e.value] = PI2QString(e.name.mid(1).toString());
|
||||
#else
|
||||
@@ -118,7 +118,7 @@ QVariant ThreadsModel::data(const QModelIndex & index, int role) const {
|
||||
case ctDelay: return QString::number(ti.delay);
|
||||
case ctState: return state_names.value(ti.state);
|
||||
case ctLoad: {
|
||||
piForeachC(PISystemMonitor::ThreadStats & s, stat) {
|
||||
for (const auto & s: stat) {
|
||||
if (s.id == llong(ti.id)) {
|
||||
return QString::number(s.cpu_load_kernel + s.cpu_load_user, 'f', 2) + " %";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user