summaryrefslogtreecommitdiffstats
path: root/src/util.cc
diff options
context:
space:
mode:
authorCameron <cameron@moodycamel.com>2020-06-10 11:32:04 (GMT)
committerCameron <cameron@moodycamel.com>2020-06-10 11:32:04 (GMT)
commit9e1e51aeb56115b94d3cf14e67934dcd51a3f5c6 (patch)
tree2de4ef07c16d59f38e68651025af33f790e443b3 /src/util.cc
parent546e27c6459b862e3394caad1c71d63da0891041 (diff)
downloadNinja-9e1e51aeb56115b94d3cf14e67934dcd51a3f5c6.zip
Ninja-9e1e51aeb56115b94d3cf14e67934dcd51a3f5c6.tar.gz
Ninja-9e1e51aeb56115b94d3cf14e67934dcd51a3f5c6.tar.bz2
Tweaks following code review
Diffstat (limited to 'src/util.cc')
-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;
}
}