summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/util.cc b/src/util.cc
index 9049f90..e8455ec 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -492,9 +492,8 @@ int GetProcessorCount() {
reinterpret_cast<PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX>(
buf.data()), &len)) {
for (DWORD i = 0; i < len; ) {
- PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info =
- reinterpret_cast<PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX>(
- buf.data() + i);
+ auto info = reinterpret_cast<PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX>(
+ buf.data() + i);
if (info->Relationship == RelationProcessorCore &&
info->Processor.GroupCount == 1) {
for (KAFFINITY core_mask = info->Processor.GroupMask[0].Mask;
@@ -504,7 +503,7 @@ int GetProcessorCount() {
}
i += info->Size;
}
- if (cores) {
+ if (cores != 0) {
return cores;
}
}