Skip to content

Commit

Permalink
address memory allocation concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
Syzuna committed Apr 11, 2024
1 parent 0f370ad commit d5b8aa6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TwitchLib.EventSub.Websockets/Client/WebsocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class WebsocketClient : IDisposable
/// </summary>
public bool IsConnected => _webSocket.State == WebSocketState.Open;
/// <summary>
/// Determines if the Client is has encountered an unrecoverable issue based on WebsocketState
/// Determines if the Client has encountered an unrecoverable issue based on WebsocketState
/// </summary>
public bool IsFaulted => _webSocket.CloseStatus != WebSocketCloseStatus.Empty && _webSocket.CloseStatus != WebSocketCloseStatus.NormalClosure;

Expand Down Expand Up @@ -120,7 +120,7 @@ private async Task ProcessDataAsync()

if (payloadSize + receiveResult.Count >= storeSize)
{
storeSize *= 2;
storeSize += 4096;
var newStore = MemoryPool<byte>.Shared.Rent(storeSize).Memory;
store.CopyTo(newStore);
store = newStore;
Expand Down

0 comments on commit d5b8aa6

Please sign in to comment.