Skip to content

Commit bb4def6

Browse files
committed
Remove comment, simplify if.
1 parent 062dc94 commit bb4def6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/std/math/egcd.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pub fn egcd(a: anytype, b: anytype) ExtendedGreatestCommonDivisor(@TypeOf(a, b))
2424
},
2525
else => |T| T,
2626
};
27-
if (@typeInfo(S) != .int or @typeInfo(S).int.signedness != .signed) {
27+
28+
if (@typeInfo(S) != .int or @typeInfo(S).int.signedness != .signed)
2829
@compileError("`a` and `b` must be signed integers");
29-
}
3030

3131
std.debug.assert(a != 0 or b != 0);
3232

@@ -169,7 +169,6 @@ test {
169169
const b: i4 = 5;
170170
const r = egcd(a, b);
171171
const g = r.gcd;
172-
// Avoid overflow in assert.
173172
const s: i8 = r.bezout_coeff_1;
174173
const t: i8 = r.bezout_coeff_2;
175174
try std.testing.expect(s * a + t * b == g);

0 commit comments

Comments
 (0)