Don't increment cpuData index inline

pull/20/head v0.1.0
jackun 4 years ago
parent 6d3d869586
commit bf45bd9a02
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -206,8 +206,9 @@ bool CPUStats::UpdateCoreMhz() {
while (std::getline(cpuInfo, row) && i < m_cpuData.size()) {
if (row.find("MHz") != std::string::npos){
row = std::regex_replace(row, std::regex(R"([^0-9.])"), "");
if (!try_stoi(m_cpuData[i++].mhz, row))
m_cpuData[i++].mhz = 0;
if (!try_stoi(m_cpuData[i].mhz, row))
m_cpuData[i].mhz = 0;
i++;
}
}
return true;

Loading…
Cancel
Save