mirror of
https://github.com/polybar/polybar.git
synced 2026-02-22 08:15:54 +00:00
refactor(core): Clean-up
- use "#pragma once" instead of the regular include guard - fix errors and warnings reported by cppcheck
This commit is contained in:
@ -89,9 +89,10 @@ bool CpuModule::read_values()
|
||||
std::ifstream in(PATH_CPU_INFO);
|
||||
std::string str;
|
||||
|
||||
while (std::getline(in, str) && str.find("cpu") == 0) {
|
||||
while (std::getline(in, str) && str.compare(0, 3, "cpu") == 0) {
|
||||
// skip the accumulated line
|
||||
if (str.find("cpu ") == 0) continue;
|
||||
if (str.compare(0, 4, "cpu ") == 0)
|
||||
continue;
|
||||
|
||||
auto values = string::split(str, ' ');
|
||||
auto cpu = std::make_unique<CpuTime>();
|
||||
|
||||
Reference in New Issue
Block a user