Skip to content

Commit

Permalink
Quick fixes to make Sonar Happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxlider committed Nov 21, 2023
1 parent db61c95 commit 76b8164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions KAST.Core/Services/ServerInfoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace KAST.Core.Services
{
public class ServerInfoService
{
private PerformanceCounter _cpuCounter;
private PerformanceCounter _ramCounter;
private readonly PerformanceCounter _cpuCounter;
private readonly PerformanceCounter _ramCounter;

[SupportedOSPlatform("windows")]
public ServerInfoService()
Expand Down
4 changes: 2 additions & 2 deletions KAST/Pages/ServerInfos.razor
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
{
var cpuVal = ServerInfoService.GetCpuUsage();
// var cpuData = CpuSeries.First().Data;
if (cpuVal != float.NaN)
if (float.IsNaN(cpuVal))
CpuSeries.First().Data = CpuSeries.First().Data.Concat(new double[] { cpuVal }).ToArray(); // Why on EARTH do they use arrays ?
var ramVal = ServerInfoService.GetMemUsage();
if (ramVal != float.NaN)
if (float.IsNaN(ramVal))
RamSeries.First().Data = RamSeries.First().Data.Concat(new double[] { ramVal }).ToArray();


Expand Down

0 comments on commit 76b8164

Please sign in to comment.