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;
|
get => _value;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (Type == typeof(uint))
|
if (value is byte[] bytes)
|
||||||
_value = BitConverter.ToUInt32((byte[])value, 0);
|
{
|
||||||
else if (Type == typeof(ulong))
|
if (Type == typeof(uint))
|
||||||
_value = BitConverter.ToUInt64((byte[])value, 0);
|
_value = BitConverter.ToUInt32(bytes, 0);
|
||||||
|
else if (Type == typeof(ulong))
|
||||||
|
_value = BitConverter.ToUInt64(bytes, 0);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
_value = value;
|
_value = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user