opt. for performance

This commit is contained in:
lollipopkit
2023-04-16 19:41:54 +08:00
parent a3537a67c2
commit bf22309fe5
6 changed files with 72 additions and 69 deletions

View File

@@ -114,10 +114,8 @@ List<OneTimeCpuStatus> parseCPU(String raw) {
final cpuTempReg = RegExp(r'(x86_pkg_temp|cpu_thermal)');
String parseCPUTemp(List<String> segments) {
String parseCPUTemp(String type, String value) {
const noMatch = "/sys/class/thermal/thermal_zone*/type";
final type = segments[0];
final value = segments[1];
// Not support to get CPU temperature
if (value.contains(noMatch) ||
type.contains(noMatch) ||