Skip to content

Commit a1786dc

Browse files
authoredDec 24, 2024··
chore: avoid un-necessary allocation (#92)
1 parent f45010e commit a1786dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎options.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ func WithDecompressFn(decompressFn func(c *gin.Context)) Option {
5252
}
5353

5454
// Using map for better lookup performance
55-
type ExcludedExtensions map[string]bool
55+
type ExcludedExtensions map[string]struct{}
5656

5757
func NewExcludedExtensions(extensions []string) ExcludedExtensions {
5858
res := make(ExcludedExtensions)
5959
for _, e := range extensions {
60-
res[e] = true
60+
res[e] = struct{}{}
6161
}
6262
return res
6363
}

0 commit comments

Comments
 (0)
Please sign in to comment.