Skip to content

Commit 90bbefe

Browse files
committed
CPU (Windows): code cleanup
1 parent 69a7e64 commit 90bbefe

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/detection/cpu/cpu_windows.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,18 @@ static const char* detectNCores(FFCPUResult* cpu)
100100
ptr = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX*)(((uint8_t*)ptr) + ptr->Size)
101101
)
102102
{
103-
if (ptr->Relationship == RelationProcessorCore)
104-
++cpu->coresPhysical;
105-
else if (ptr->Relationship == RelationGroup)
103+
if (ptr->Relationship == RelationGroup)
106104
{
107105
for (uint32_t index = 0; index < ptr->Group.ActiveGroupCount; ++index)
108106
{
109107
cpu->coresOnline += ptr->Group.GroupInfo[index].ActiveProcessorCount;
110108
cpu->coresLogical += ptr->Group.GroupInfo[index].MaximumProcessorCount;
111109
}
112110
}
113-
114-
if (ptr->Relationship == RelationProcessorPackage) {
111+
else if (ptr->Relationship == RelationProcessorCore)
112+
++cpu->coresPhysical;
113+
else if (ptr->Relationship == RelationProcessorPackage)
115114
cpu->packages++;
116-
}
117115
}
118116

119117
return NULL;

0 commit comments

Comments
 (0)