Skip to content

Commit

Permalink
remove contains element
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan-sharma11 <[email protected]>
  • Loading branch information
Aryan-sharma11 committed Jan 16, 2025
1 parent d66f740 commit 16a26ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
21 changes: 0 additions & 21 deletions profile/libs.go

This file was deleted.

4 changes: 3 additions & 1 deletion profile/pathAggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package profile
import (
"path/filepath"
"regexp"
"slices"
"sort"
"strings"
)
Expand Down Expand Up @@ -126,7 +127,7 @@ func (n *Node) makeChildNodeToDir() {
func (n *Node) findChildNode(path string, depth int) *Node {
for _, child := range n.childNodes {
// case 1: regex matching
if ContainsElement(WildPaths, child.path) && child.depth == depth {
if slices.Contains(WildPaths, child.path) && child.depth == depth {
r, _ := regexp.Compile(child.path)
if r.FindString(path) == path {
return child
Expand All @@ -135,6 +136,7 @@ func (n *Node) findChildNode(path string, depth int) *Node {
} else if child.path == path && child.depth == depth {
return child
}

}

return nil
Expand Down

0 comments on commit 16a26ec

Please sign in to comment.