Add optimized
This commit is contained in:
1 parent
0ff93e1d09
commit
8c0320d837
1 file changed
+6
-6
@@ -69,12 +69,12 @@ public struct MutableUInt128
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Add(in MutableUInt128 value)
|
||||
{
|
||||
ulong low = Low + value.Low;
|
||||
Low = low;
|
||||
ulong carry = low < Low ? 1UL : 0UL;
|
||||
ulong high = High + value.High + carry;
|
||||
|
||||
High = high;
|
||||
ulong temp = Low + value.Low;
|
||||
Low = temp;
|
||||
temp = temp < Low ? 1UL : 0UL;
|
||||
temp += High;
|
||||
temp += value.High;
|
||||
High = temp;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
||||
Reference in new issue
Block a user