Skip to content

Commit

Permalink
Disable CA2022 errors (#4961)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaMilosavljevic committed Apr 3, 2024
1 parent 1cd0d89 commit 56d2884
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,10 @@ public bool TryGetDotnetPathByArchitecture(
using var headerReader = _fileHelper.GetStream(path, FileMode.Open, FileAccess.Read);
var magicBytes = new byte[4];
var cpuInfoBytes = new byte[4];
#pragma warning disable CA2022 // Avoid inexact read
headerReader.Read(magicBytes, 0, magicBytes.Length);
headerReader.Read(cpuInfoBytes, 0, cpuInfoBytes.Length);
#pragma warning restore CA2022

var magic = BitConverter.ToUInt32(magicBytes, 0);
var cpuInfo = BitConverter.ToUInt32(cpuInfoBytes, 0);
Expand Down

0 comments on commit 56d2884

Please sign in to comment.