From 8b3ae3ac75ba26f7a32deeaab6c44e3798ed5e15 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Mon, 8 Apr 2013 11:26:17 -0300 Subject: [PATCH] Update FusedDataArray.cs Fixing setters in FusedDataArray --- SubstrateCS/Source/Core/FusedDataArray.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/SubstrateCS/Source/Core/FusedDataArray.cs b/SubstrateCS/Source/Core/FusedDataArray.cs index 40d68c6..80211b1 100644 --- a/SubstrateCS/Source/Core/FusedDataArray.cs +++ b/SubstrateCS/Source/Core/FusedDataArray.cs @@ -30,12 +30,8 @@ namespace Substrate.Core get { return (_array0[x, y, z] << _array1.DataWidth) + _array1[x, y, z]; } set { - if (value >= (1 << _array1.DataWidth)) { - _array0[x, y, z] = value >> _array1.DataWidth; - _array1[x, y, z] = value & _mask1; - } - else - _array1[x, y, z] = value; + _array0[x, y, z] = value >> _array1.DataWidth; + _array1[x, y, z] = value & _mask1; } } @@ -69,12 +65,8 @@ namespace Substrate.Core get { return (_array0[i] << _array1.DataWidth) + _array1[i]; } set { - if (value >= (1 << _array1.DataWidth)) { - _array0[i] = value >> _array1.DataWidth; - _array1[i] = value & _mask1; - } - else - _array1[i] = value; + _array0[i] = value >> _array1.DataWidth; + _array1[i] = value & _mask1; } }