Skip to content

Commit

Permalink
more descriptive variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Copi committed Jan 22, 2025
1 parent c4bb373 commit 079a217
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rules/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func formatPath(pattern string, m Attributes) (string, bool) {
// this will be the only allocation
sb.Grow(len(pattern) * 2)

all := true
allFound := true
var segment string
for found := true; found; {
segment, pattern, found = strings.Cut(pattern, "/")
Expand All @@ -140,15 +140,15 @@ func formatPath(pattern string, m Attributes) (string, bool) {
if attr, ok := m.GetAttribute(segment[1:]); ok {
sb.WriteString(attr)
} else {
all = false
allFound = false
sb.WriteString(segment)
}
default:
sb.WriteByte('/')
sb.WriteString(segment)
}
}
return sb.String(), all
return sb.String(), allFound
}

// Keep the bool return value, because it's tricky to check for null
Expand Down

0 comments on commit 079a217

Please sign in to comment.