Skip to content

Commit

Permalink
test: remove unnecessary initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed Dec 10, 2024
1 parent 099f1cb commit 5654380
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _deploy/p/gnoswap/pool/swap_math_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ func sqrt(t *testing.T, x *u256.Uint) *u256.Uint {
z := new(u256.Uint).Set(x)
y := new(u256.Uint).Rsh(z, 1) // Initial guess is x / 2

temp := new(u256.Uint)
for y.Cmp(z) < 0 {
z.Set(y)
temp := new(u256.Uint).Div(x, z)
temp.Div(x, z)
y.Add(z, temp).Rsh(y, 1)
}
return z
Expand Down

0 comments on commit 5654380

Please sign in to comment.