From 90bbefe11aa10f8527c61055948075f2c54b5df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 26 Nov 2024 22:02:57 +0800 Subject: [PATCH] CPU (Windows): code cleanup --- src/detection/cpu/cpu_windows.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/detection/cpu/cpu_windows.c b/src/detection/cpu/cpu_windows.c index 411571010..09f422e12 100644 --- a/src/detection/cpu/cpu_windows.c +++ b/src/detection/cpu/cpu_windows.c @@ -100,9 +100,7 @@ static const char* detectNCores(FFCPUResult* cpu) ptr = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX*)(((uint8_t*)ptr) + ptr->Size) ) { - if (ptr->Relationship == RelationProcessorCore) - ++cpu->coresPhysical; - else if (ptr->Relationship == RelationGroup) + if (ptr->Relationship == RelationGroup) { for (uint32_t index = 0; index < ptr->Group.ActiveGroupCount; ++index) { @@ -110,10 +108,10 @@ static const char* detectNCores(FFCPUResult* cpu) cpu->coresLogical += ptr->Group.GroupInfo[index].MaximumProcessorCount; } } - - if (ptr->Relationship == RelationProcessorPackage) { + else if (ptr->Relationship == RelationProcessorCore) + ++cpu->coresPhysical; + else if (ptr->Relationship == RelationProcessorPackage) cpu->packages++; - } } return NULL;