Skip to content

Commit

Permalink
selector: use a string builder to avoid excessive allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMure committed Sep 1, 2024
1 parent 431a9f0 commit 4d0a0a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions capability/policy/selector/selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
type Selector []segment

func (s Selector) String() string {
var str string
var res strings.Builder
for _, seg := range s {
str += seg.String()
res.WriteString(seg.String())
}
return str
return res.String()
}

var Identity = segment{".", true, false, false, nil, "", 0}
Expand Down

0 comments on commit 4d0a0a2

Please sign in to comment.