Skip to content

Commit

Permalink
server/auth: simplify code for isValidPermissionRange
Browse files Browse the repository at this point in the history
Not a big deal, but to make this function clearer.

Signed-off-by: Jes Cok <[email protected]>
  • Loading branch information
callthingsoff committed Apr 17, 2024
1 parent e37a67e commit aafe229
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 aafe229

Please sign in to comment.