refactor: Directly swap two variables to optimize code (#1272)

荆长逯 created

Signed-off-by: jingchanglu <jingchanglu@outlook.com>

Change summary

entities/identity/key_test.go | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Detailed changes

entities/identity/key_test.go 🔗

@@ -52,9 +52,7 @@ func TestStoreLoad(t *testing.T) {
 
 	// See https://github.com/golang/crypto/pull/175
 	rsaPriv := read.private.PrivateKey.(*rsa.PrivateKey)
-	back := rsaPriv.Primes[0]
-	rsaPriv.Primes[0] = rsaPriv.Primes[1]
-	rsaPriv.Primes[1] = back
+	rsaPriv.Primes[0], rsaPriv.Primes[1] = rsaPriv.Primes[1], rsaPriv.Primes[0]
 
 	require.True(t, k.private.PrivateKey.(*rsa.PrivateKey).Equal(read.private.PrivateKey))
 }