Skip to content

Commit

Permalink
Fix MosCpuInfoProvider (#2360)
Browse files Browse the repository at this point in the history
* Fixed MosCpuInfoProvider

* Use null instead of 0.
  • Loading branch information
timcassell authored Jul 9, 2023
1 parent d883fdd commit ca9d8b9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/BenchmarkDotNet/Portability/Cpu/MosCpuInfoProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Management;
using JetBrains.Annotations;
using Perfolizer.Horology;

namespace BenchmarkDotNet.Portability.Cpu
Expand Down Expand Up @@ -49,9 +48,9 @@ private static CpuInfo Load()
processorsCount > 0 ? processorsCount : (int?) null,
physicalCoreCount > 0 ? (int?) physicalCoreCount : null,
logicalCoreCount > 0 ? (int?) logicalCoreCount : null,
nominalClockSpeed > 0 && logicalCoreCount > 0 ? Frequency.FromMHz(nominalClockSpeed) : (Frequency?)null,
maxClockSpeed > 0 && logicalCoreCount > 0 ? Frequency.FromMHz(maxClockSpeed) : 0,
minClockSpeed > 0 && logicalCoreCount > 0 ? Frequency.FromMHz(minClockSpeed) : (Frequency?)null);
nominalClockSpeed > 0 && logicalCoreCount > 0 ? Frequency.FromMHz(nominalClockSpeed) : (Frequency?) null,
minClockSpeed > 0 && logicalCoreCount > 0 ? Frequency.FromMHz(minClockSpeed) : (Frequency?) null,
maxClockSpeed > 0 && logicalCoreCount > 0 ? Frequency.FromMHz(maxClockSpeed) : (Frequency?) null);
}
}
}

0 comments on commit ca9d8b9

Please sign in to comment.