From 1ae34c232ab27f38d0d2bf151a32850bfde297b2 Mon Sep 17 00:00:00 2001 From: Jason Elie Bou Kheir <5115126+jasonboukheir@users.noreply.github.com> Date: Tue, 20 Dec 2022 14:11:44 -0800 Subject: [PATCH] perf(websocket): change `WebSocketEvent` to be a struct --- Runtime/Algorand.Unity.WalletConnect/JsonRpcClient.cs | 2 -- Runtime/Algorand.Unity.WebSocket/NativeWebSocketClient.cs | 1 - Runtime/Algorand.Unity.WebSocket/WebSocketEvent.cs | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Runtime/Algorand.Unity.WalletConnect/JsonRpcClient.cs b/Runtime/Algorand.Unity.WalletConnect/JsonRpcClient.cs index fa039c6d5..6975dc4b4 100644 --- a/Runtime/Algorand.Unity.WalletConnect/JsonRpcClient.cs +++ b/Runtime/Algorand.Unity.WalletConnect/JsonRpcClient.cs @@ -170,8 +170,6 @@ private async UniTaskVoid PollJsonRpcMessages(CancellationToken cancellationToke while (true) { var evt = await webSocketClient.PollUntilEvent(cancellationToken); - if (evt == null) - return; switch (evt.Type) { case WebSocketEventType.Payload: diff --git a/Runtime/Algorand.Unity.WebSocket/NativeWebSocketClient.cs b/Runtime/Algorand.Unity.WebSocket/NativeWebSocketClient.cs index a07b8017f..9967d4856 100644 --- a/Runtime/Algorand.Unity.WebSocket/NativeWebSocketClient.cs +++ b/Runtime/Algorand.Unity.WebSocket/NativeWebSocketClient.cs @@ -4,7 +4,6 @@ using System.Net.WebSockets; using System.Threading; using Cysharp.Threading.Tasks; -using UnityEngine; namespace Algorand.Unity.WebSocket { diff --git a/Runtime/Algorand.Unity.WebSocket/WebSocketEvent.cs b/Runtime/Algorand.Unity.WebSocket/WebSocketEvent.cs index 4cafbc195..244a7818f 100644 --- a/Runtime/Algorand.Unity.WebSocket/WebSocketEvent.cs +++ b/Runtime/Algorand.Unity.WebSocket/WebSocketEvent.cs @@ -1,6 +1,6 @@ namespace Algorand.Unity.WebSocket { - public class WebSocketEvent + public struct WebSocketEvent { public enum WebSocketEventType {