Skip to content

Commit f1a5504

Browse files
committed
fixup
1 parent ab26fe8 commit f1a5504

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

source/mir/bignum/integer.d

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,17 @@ struct BigInt(uint maxSize64)
172172

173173
///
174174
ref opAssign(uint rhsSize64)(auto ref scope const BigInt!rhsSize64 rhs) return
175-
@safe pure nothrow @nogc
176-
in (rhs.length <= maxSize64)
175+
@trusted pure nothrow @nogc
176+
in (rhs.length <= this.data.length)
177177
{
178-
this.sign = rhs.sign;
179-
this.length = rhs.length;
180-
version(LittleEndian)
178+
static if (maxSize64 == rhsSize64)
181179
{
182-
data[0 .. length] = rhs.data[0 .. length];
183-
}
184-
else
185-
{
186-
data[$ - length .. $] = rhs.data[$ - length .. $];
180+
if (&this is &rhs)
181+
return this;
187182
}
183+
this.sign = rhs.sign;
184+
this.length = rhs.length;
185+
this.data[0 .. length] = rhs.data[0 .. length];
188186
return this;
189187
}
190188

0 commit comments

Comments
 (0)