We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab26fe8 commit f1a5504Copy full SHA for f1a5504
1 file changed
source/mir/bignum/integer.d
@@ -172,19 +172,17 @@ struct BigInt(uint maxSize64)
172
173
///
174
ref opAssign(uint rhsSize64)(auto ref scope const BigInt!rhsSize64 rhs) return
175
- @safe pure nothrow @nogc
176
- in (rhs.length <= maxSize64)
+ @trusted pure nothrow @nogc
+ in (rhs.length <= this.data.length)
177
{
178
- this.sign = rhs.sign;
179
- this.length = rhs.length;
180
- version(LittleEndian)
+ static if (maxSize64 == rhsSize64)
181
182
- data[0 .. length] = rhs.data[0 .. length];
183
- }
184
- else
185
- {
186
- data[$ - length .. $] = rhs.data[$ - length .. $];
+ if (&this is &rhs)
+ return this;
187
}
+ this.sign = rhs.sign;
+ this.length = rhs.length;
+ this.data[0 .. length] = rhs.data[0 .. length];
188
return this;
189
190
0 commit comments