Fixed bug in SetBit

pull/10/head
David Hall 2018-07-27 09:09:43 -06:00
parent 5739032c58
commit ee0d7a0e2c
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ namespace Vanara.Extensions
{
long bit = 1 << idx;
var l = bits.ToInt64(null);
bits = (T)(object)(value ? l | bit : l & ~bit);
bits = (T)Convert.ChangeType(value ? l | bit : l & ~bit, typeof(T));
}
}
}