From a1786dc85fd644875b8c07f21a8a9d3dfb45c06c Mon Sep 17 00:00:00 2001 From: manish Date: Tue, 24 Dec 2024 09:38:12 +0530 Subject: [PATCH] chore: avoid un-necessary allocation (#92) --- options.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options.go b/options.go index 6b3bc3f..c0953e0 100644 --- a/options.go +++ b/options.go @@ -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 }