Skip to content

Commit 21bacae

Browse files
committed
Add comment re: sorting and binary search
Signed-off-by: Akshay Shah <[email protected]>
1 parent b6e9cd4 commit 21bacae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

interceptors/protovalidate/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func WithIgnoreMessages(msgs ...protoreflect.MessageType) Option {
4343
}
4444

4545
func (o *options) shouldIgnoreMessage(fqn protoreflect.FullName) bool {
46+
// Names are sorted in WithIgnoreMessages, so we can use binary search.
4647
_, found := slices.BinarySearch(o.ignoreMessages, fqn)
4748
return found
4849
}

0 commit comments

Comments
 (0)