From d770d53f4b42472e7e0df14e281aa40cda30a62a Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Mon, 7 Aug 2023 12:01:15 -0400 Subject: [PATCH] remove unnecessary file `slice.go` --- internal/helpers/slice.go | 13 ------------- internal/js_parser/js_parser.go | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 internal/helpers/slice.go diff --git a/internal/helpers/slice.go b/internal/helpers/slice.go deleted file mode 100644 index 449a70aff79..00000000000 --- a/internal/helpers/slice.go +++ /dev/null @@ -1,13 +0,0 @@ -package helpers - -func StringSlicesAreEqual(a []string, b []string) bool { - if len(a) != len(b) { - return false - } - for i, ai := range a { - if ai != b[i] { - return false - } - } - return true -} diff --git a/internal/js_parser/js_parser.go b/internal/js_parser/js_parser.go index e54e75f02bc..18a371781fc 100644 --- a/internal/js_parser/js_parser.go +++ b/internal/js_parser/js_parser.go @@ -11703,7 +11703,7 @@ func (p *parser) instantiateDefineExpr(loc logger.Loc, expr config.DefineExpr, o // Substitute user-specified defines if defines, ok := p.options.defines.DotDefines[parts[len(parts)-1]]; ok { for _, define := range defines { - if define.Data.DefineExpr != nil && helpers.StringSlicesAreEqual(define.Parts, parts) { + if define.Data.DefineExpr != nil && helpers.StringArraysEqual(define.Parts, parts) { return p.instantiateDefineExpr(loc, *define.Data.DefineExpr, opts) } } @@ -11713,7 +11713,7 @@ func (p *parser) instantiateDefineExpr(loc logger.Loc, expr config.DefineExpr, o // Check injected dot names if names, ok := p.injectedDotNames[parts[len(parts)-1]]; ok { for _, name := range names { - if helpers.StringSlicesAreEqual(name.parts, parts) { + if helpers.StringArraysEqual(name.parts, parts) { return p.instantiateInjectDotName(loc, name, opts.assignTarget) } }