File tree 3 files changed +7
-5
lines changed
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ internal class LoadReader: Reader<CPU_Load> {
70
70
}
71
71
self . CPUUsageLock. unlock ( )
72
72
73
- let showHyperthratedCores = Store . shared. bool ( key: " CPU_hyperhreading " , defaultValue: false )
73
+ let showHyperthratedCores = Store . shared. bool ( key: " CPU_hyperhreading " , defaultValue: false )
74
74
if showHyperthratedCores || !self . hasHyperthreadingCores {
75
75
self . response. usagePerCore = self . usagePerCore
76
76
} else {
@@ -355,13 +355,15 @@ public class FrequencyReader: Reader<[Double]> {
355
355
356
356
private func calculateFrequencies( dict: CFDictionary , freqs: [ Int32 ] ) -> Double {
357
357
let items = self . getResidencies ( dict: dict)
358
- let offset = items. firstIndex { $0. 0 != " IDLE " && $0. 0 != " DOWN " && $0. 0 != " OFF " } !
358
+ guard let offset = items. firstIndex ( where : { $0. 0 != " IDLE " && $0. 0 != " DOWN " && $0. 0 != " OFF " } ) else { return 0 }
359
359
let usage = items. dropFirst ( offset) . reduce ( 0.0 ) { $0 + Double( $1. f) }
360
360
let count = freqs. count
361
361
var avgFreq : Double = 0
362
362
363
363
for i in 0 ..< count {
364
- let percent = usage == 0 ? 0 : Double ( items [ i + offset] . f) / usage
364
+ let key = i + offset
365
+ if !items. indices. contains ( key) { continue }
366
+ let percent = usage == 0 ? 0 : Double ( items [ key] . f) / usage
365
367
avgFreq += percent * Double( freqs [ i] )
366
368
}
367
369
Original file line number Diff line number Diff line change 17
17
<key >CFBundleShortVersionString </key >
18
18
<string >$(MARKETING_VERSION) </string >
19
19
<key >CFBundleVersion </key >
20
- <string >657 </string >
20
+ <string >659 </string >
21
21
<key >Description </key >
22
22
<string >Simple macOS system monitor in your menu bar </string >
23
23
<key >LSApplicationCategoryType </key >
Original file line number Diff line number Diff line change 13
13
<key >CFBundleShortVersionString </key >
14
14
<string >2.11.24 </string >
15
15
<key >CFBundleVersion </key >
16
- <string >657 </string >
16
+ <string >659 </string >
17
17
<key >NSExtension </key >
18
18
<dict >
19
19
<key >NSExtensionPointIdentifier </key >
You can’t perform that action at this time.
0 commit comments