Skip to content

Commit ab17d83

Browse files
committed
Fix Cppia II
1 parent 65f0dd7 commit ab17d83

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

std/haxe/math/bigint/MutableBigInt_.hx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ class MutableBigInt_ extends BigInt_ {
4848
Set the value of this big int with an integer of value `value`.
4949
**/
5050
public function setFromInt(value:Int):Void {
51+
ensureCapacity(1, false);
5152
#if cppia
5253
if ( m_data == null) return;
5354
#end
54-
ensureCapacity(1, false);
5555
m_data.set(0, value);
5656
m_count = 1;
5757
}
@@ -79,9 +79,6 @@ class MutableBigInt_ extends BigInt_ {
7979
if ((value == null) || (value.length < 1)) {
8080
throw new BigIntException(BigIntError.INVALID_ARGUMENT);
8181
}
82-
#if cppia
83-
if ( m_data == null) return;
84-
#end
8582
var negate = value.charCodeAt(0) == 0x2d;
8683
var index = negate ? 1 : 0;
8784
if (value.length <= index) {
@@ -142,6 +139,9 @@ class MutableBigInt_ extends BigInt_ {
142139
}
143140
var neg = value.get(length - 1) >>> 31;
144141
ensureCapacity(length + neg, false);
142+
#if cppia
143+
if ( m_data == null) return;
144+
#end
145145
m_data.set(length + neg - 1, 0);
146146
MultiwordArithmetic.copy(m_data, value, length);
147147
m_count = length + neg;

0 commit comments

Comments
 (0)