Skip to content

Commit eaa357b

Browse files
committed
Update the code to use Random.Shared
1 parent 2a8be4a commit eaa357b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CUIFlavoredPortfolioSite/App.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected override async Task OnInitializedAsync()
6464

6565
private async Task TypeAndExecuteCommandAsync(string text)
6666
{
67-
var r = new Random((int)(DateTime.Now.Ticks % int.MaxValue));
67+
var r = Random.Shared;
6868
foreach (var c in text)
6969
{
7070
this.CommandLineInputText += c;
@@ -138,7 +138,7 @@ private async ValueTask ExecuteCommandAsync()
138138
this.StateHasChanged();
139139
}
140140

141-
private CancellationTokenSource _CommandCanceller;
141+
private CancellationTokenSource? _CommandCanceller;
142142

143143
private async ValueTask ProcessCommandLineAsync(string commandLineInputText, bool noSaveHistory = false)
144144
{

0 commit comments

Comments
 (0)