mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
std::math::bigint: Fixed init_with_array with empty array
This commit is contained in:
committed by
Christoffer Lerno
parent
38110b0269
commit
ed62268997
@@ -63,6 +63,13 @@ fn BigInt* BigInt.init_with_u128(&self, uint128 value)
|
||||
fn BigInt* BigInt.init_with_array(&self, uint[] values)
|
||||
{
|
||||
self.data[..] = 0;
|
||||
|
||||
if (values.len == 0)
|
||||
{
|
||||
self.len = 1;
|
||||
return self;
|
||||
}
|
||||
|
||||
self.len = values.len;
|
||||
|
||||
foreach_r(i, val : values)
|
||||
|
||||
Reference in New Issue
Block a user