[#752] innerring: Simplify keyPosition()
All checks were successful
DCO action / DCO (pull_request) Successful in 3m0s
Vulncheck / Vulncheck (pull_request) Successful in 3m10s
Build / Build Components (1.20) (pull_request) Successful in 4m3s
Build / Build Components (1.21) (pull_request) Successful in 4m8s
Tests and linters / Staticcheck (pull_request) Successful in 5m13s
Tests and linters / Lint (pull_request) Successful in 5m44s
Tests and linters / Tests (1.20) (pull_request) Successful in 7m0s
Tests and linters / Tests (1.21) (pull_request) Successful in 7m7s
Tests and linters / Tests with -race (pull_request) Successful in 7m50s

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-10-25 16:06:12 +03:00
parent cddc58ace2
commit 9f7c2d8810

View file

@ -110,15 +110,11 @@ func (s *innerRingIndexer) AlphabetIndex() (int32, error) {
// keyPosition returns "-1" if key is not found in the list, otherwise returns
// index of the key.
func keyPosition(key *keys.PublicKey, list keys.PublicKeys) (result int32) {
result = -1
func keyPosition(key *keys.PublicKey, list keys.PublicKeys) int32 {
for i := range list {
if key.Equal(list[i]) {
result = int32(i)
break
return int32(i)
}
}
return result
return -1
}