Skip to content

Commit 5654380

Browse files
committed
test: remove unnecessary initialization
1 parent 099f1cb commit 5654380

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

_deploy/p/gnoswap/pool/swap_math_test.gno

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,10 @@ func sqrt(t *testing.T, x *u256.Uint) *u256.Uint {
201201
z := new(u256.Uint).Set(x)
202202
y := new(u256.Uint).Rsh(z, 1) // Initial guess is x / 2
203203

204+
temp := new(u256.Uint)
204205
for y.Cmp(z) < 0 {
205206
z.Set(y)
206-
temp := new(u256.Uint).Div(x, z)
207+
temp.Div(x, z)
207208
y.Add(z, temp).Rsh(y, 1)
208209
}
209210
return z

0 commit comments

Comments
 (0)