optimization:use bytes.Equal instead of bytes.Compare

This commit is contained in:
Wang Guoliang 2017-09-13 20:58:14 +08:00
parent fe4cfd03b5
commit 383b0c176c
No known key found for this signature in database
GPG Key ID: 55EC13D4306ABFE4
1 changed files with 1 additions and 1 deletions

View File

@ -381,7 +381,7 @@ func acceptPublicKey(keystr string) func(ssh.ConnMetadata, ssh.PublicKey) (*ssh.
panic(fmt.Errorf("error parsing key: %s", err))
}
return func(_ ssh.ConnMetadata, inkey ssh.PublicKey) (*ssh.Permissions, error) {
if bytes.Compare(inkey.Marshal(), goodkey.Marshal()) == 0 {
if bytes.Equal(inkey.Marshal(), goodkey.Marshal()) {
return nil, nil
}