From 7b25639c400fb1956ed211b34b20c215a71b03a7 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Fri, 25 Aug 2023 14:38:51 -0500 Subject: [PATCH] Only convert value when necessary --- UIX/Microsoft/Iris/Debug/Data/InterpreterObject.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/UIX/Microsoft/Iris/Debug/Data/InterpreterObject.cs b/UIX/Microsoft/Iris/Debug/Data/InterpreterObject.cs index e59afcb..990294a 100644 --- a/UIX/Microsoft/Iris/Debug/Data/InterpreterObject.cs +++ b/UIX/Microsoft/Iris/Debug/Data/InterpreterObject.cs @@ -16,12 +16,17 @@ public class InterpreterObject get => _value; set { - if (Type == typeof(uint)) - _value = BitConverter.ToUInt32((byte[])value, 0); - else if (Type == typeof(ulong)) - _value = BitConverter.ToUInt64((byte[])value, 0); + if (value is byte[] bytes) + { + if (Type == typeof(uint)) + _value = BitConverter.ToUInt32(bytes, 0); + else if (Type == typeof(ulong)) + _value = BitConverter.ToUInt64(bytes, 0); + } else + { _value = value; + } } }