mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Only convert value when necessary
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user