Skip to content

Commit

Permalink
chore: avoid un-necessary allocation (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
manisharma authored Dec 24, 2024
1 parent f45010e commit a1786dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ func WithDecompressFn(decompressFn func(c *gin.Context)) Option {
}

// Using map for better lookup performance
type ExcludedExtensions map[string]bool
type ExcludedExtensions map[string]struct{}

func NewExcludedExtensions(extensions []string) ExcludedExtensions {
res := make(ExcludedExtensions)
for _, e := range extensions {
res[e] = true
res[e] = struct{}{}
}
return res
}
Expand Down

0 comments on commit a1786dc

Please sign in to comment.