[SIL.Media] Fix 'Cast to same type' code warnings
There are 159 "Cast to same type" code warnings (https://github.com/sillsdev/libpalaso/security/code-scanning?page=7&query=is%3Aopen+branch%3Amaster+rule%3Acs%2Fuseless-cast-to-self), most of them in [SIL.Windows.Forms*], but the 8 that aren't (https://github.com/sillsdev/libpalaso/security/code-scanning/2461 thru https://github.com/sillsdev/libpalaso/security/code-scanning/2468) are in [SIL.Media]. This pr fixes those, with some additional cleanup in the three offending files.
Palaso Tests
3 files - 1 3 suites - 1 14m 33s :stopwatch: - 3m 44s 4 935 tests ± 0 4 706 :white_check_mark: ± 0 229 :zzz: ± 0 0 :x: ±0 14 272 runs - 1 785 13 648 :white_check_mark: - 1 722 624 :zzz: - 63 0 :x: ±0
Results for commit ec11db20. ± Comparison against base commit 1ae6a9b6.
:recycle: This comment has been updated with latest results.
SIL.Media/AlsaAudio/AlsaAudioDevice.cs line 535 at r1 (raw file):
n = (ulong)_bufferSize; ulong start_threshold; if (_startDelay <= 0)
I realize that this PR is for something else anyway, but since you're changing these lines, what about using either a ternary or:
Code snippet:
start_threshold = (ulong)((double)rate * _startDelay / 1000000);
if (_startDelay <= 0)
start_threshold += n;