mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-04-05 21:44:05 +00:00
Use Select instead of manual foreach
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a14486bd36
commit
af54ab3eab
@@ -173,15 +173,12 @@ public sealed partial class A2R
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
foreach(uint c in cumulativeIndexTicks)
|
||||
{
|
||||
ulong timePs = (ulong)c * indexResolution;
|
||||
ulong scaled = timePs / dataResolution;
|
||||
IEnumerable<ulong> scaledTicks = cumulativeIndexTicks.Select(c => ((ulong)c * indexResolution) / dataResolution);
|
||||
|
||||
if(scaled > uint.MaxValue) return ErrorNumber.InvalidArgument;
|
||||
if(scaledTicks.Any(scaled => scaled > uint.MaxValue))
|
||||
return ErrorNumber.InvalidArgument;
|
||||
|
||||
cumulativeDataTicks.Add((uint)scaled);
|
||||
}
|
||||
cumulativeDataTicks = scaledTicks.Select(scaled => (uint)scaled).ToList();
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user