From bac127bcb68db7a4f53e6e7c2e701194d28918f7 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Fri, 19 Nov 2021 07:18:40 +0100 Subject: [PATCH] cpuCache() fix (windows) --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/cpu.js | 10 +++++----- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f48a381..4ba1540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 5.9.15 | 2021-11-19 | `cpuCache()` fix (windows) | | 5.9.14 | 2021-11-17 | `versions()` python 2 monterey (deprecated warning) fix (mac OS) | | 5.9.13 | 2021-11-14 | `time()` timezone name, `l1 cache` improvements | | 5.9.12 | 2021-11-13 | `users()` fix data check (windows) | diff --git a/docs/history.html b/docs/history.html index a237eb3..29b529c 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.9.15 + 2021-11-19 + cpuCache() fix (windows) + 5.9.14 2021-11-17 diff --git a/docs/index.html b/docs/index.html index 9e0d42e..a72af80 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.9.14
+
New Version: 5.9.15
diff --git a/lib/cpu.js b/lib/cpu.js index 1fe4160..a6da00d 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -1428,16 +1428,16 @@ function cpuCache(callback) { const installedSize = util.getValue(lines, 'InstalledSize'); // L1 Instructions if (level === '3' && cacheType === '3') { - result.cache.l1i = parseInt(installedSize, 10); + result.l1i = parseInt(installedSize, 10); } // L1 Data if (level === '3' && cacheType === '4') { - result.cache.l1d = parseInt(installedSize, 10); + result.l1d = parseInt(installedSize, 10); } // L1 all - if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) { - result.cache.l1i = parseInt(installedSize, 10) / 2; - result.cache.l1d = parseInt(installedSize, 10) / 2; + if (level === '3' && cacheType === '5' && !result.l1i && !result.l1d) { + result.l1i = parseInt(installedSize, 10) / 2; + result.l1d = parseInt(installedSize, 10) / 2; } }); }