optimization:use bytes.Equal instead of bytes.Compare
This commit is contained in:
parent
fe4cfd03b5
commit
383b0c176c
|
@ -381,7 +381,7 @@ func acceptPublicKey(keystr string) func(ssh.ConnMetadata, ssh.PublicKey) (*ssh.
|
||||||
panic(fmt.Errorf("error parsing key: %s", err))
|
panic(fmt.Errorf("error parsing key: %s", err))
|
||||||
}
|
}
|
||||||
return func(_ ssh.ConnMetadata, inkey ssh.PublicKey) (*ssh.Permissions, error) {
|
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
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue