Skip to content

Commit

Permalink
Merge pull request #17816 from callthingsoff/simplify_isValidPermissi…
Browse files Browse the repository at this point in the history
…onRange

server/auth: simplify code for isValidPermissionRange
  • Loading branch information
serathius authored Apr 20, 2024
2 parents e246bb8 + aafe229 commit 0b7bae2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions server/auth/range_perm_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func isValidPermissionRange(key, rangeEnd []byte) bool {
if len(key) == 0 {
return false
}
if rangeEnd == nil || len(rangeEnd) == 0 { // ensure rule b1
if len(rangeEnd) == 0 { // ensure rule b1
return true
}

Expand All @@ -199,9 +199,5 @@ func isValidPermissionRange(key, rangeEnd []byte) bool {
return true
}

if isOpenEnded(rangeEnd) {
return true
}

return false
return isOpenEnded(rangeEnd)
}

0 comments on commit 0b7bae2

Please sign in to comment.