Skip to content

Commit 01705e1

Browse files
Remove unnecessary call to ReceiveData (sync method) in ToStringAsync
1 parent a674d46 commit 01705e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dotnet/src/dotnetframework/GxClasses/Domain/GxHttpClient.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,11 +1911,12 @@ public override string ToString()
19111911
#if NETCORE
19121912
public async Task<string> ToStringAsync()
19131913
{
1914-
if (await ReceiveDataAsync() == null)
1914+
byte[] bytes = await ReceiveDataAsync();
1915+
if (bytes == null)
19151916
return string.Empty;
19161917
if (_encoding == null)
19171918
_encoding = Encoding.UTF8;
1918-
string responseString = _encoding.GetString(ReceiveData);
1919+
string responseString = _encoding.GetString(bytes);
19191920
GXLogging.DebugSanitized(log, "_responseString " + responseString);
19201921
return responseString;
19211922
}

0 commit comments

Comments
 (0)