Skip to content

Commit 27c487c

Browse files
committed
This await no longer needed, slows things down
1 parent c97db41 commit 27c487c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Blazor.FileReader/FileReaderJsInterop.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private async Task<int> ReadFileUnmarshalledAsync(
137137
var id = ++_readFileUnmarshalledCallIdSource;
138138
_readFileUnmarshalledCalls[id] = taskCompletionSource;
139139

140-
await Task.Run(() => CurrentJSRuntime.InvokeUnmarshalled<ReadFileParams, int>(
140+
CurrentJSRuntime.InvokeUnmarshalled<ReadFileParams, int>(
141141
$"FileReaderComponent.ReadFileUnmarshalledAsync",
142142
new ReadFileParams {
143143
Buffer = buffer,
@@ -146,7 +146,7 @@ await Task.Run(() => CurrentJSRuntime.InvokeUnmarshalled<ReadFileParams, int>(
146146
FileRef = fileRef,
147147
Position = position,
148148
TaskId = id
149-
}));
149+
});
150150

151151
var bytesRead = await taskCompletionSource.Task;
152152
return bytesRead;

0 commit comments

Comments
 (0)