Skip to content

Commit

Permalink
feat(gau): use map[string]struct{} and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
lc committed Mar 2, 2022
1 parent 81580e4 commit 802222d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type JSONResult struct {
}

func WriteURLs(writer io.Writer, results <-chan string, blacklistMap map[string]struct{}, RemoveParameters bool) error {
lastURL := make(map[string]bool)
lastURL := make(map[string]struct{})
for result := range results {
buf := bytebufferpool.Get()
if len(blacklistMap) != 0 {
Expand All @@ -36,10 +36,10 @@ func WriteURLs(writer io.Writer, results <-chan string, blacklistMap map[string]
if err != nil {
continue
}
if lastURL[u.Host+u.Path] {
if _, ok := lastURL[u.Host+u.Path]; ok {
continue
} else {
lastURL[u.Host+u.Path] = true ;
lastURL[u.Host+u.Path] = struct{}{} ;
}

}
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/valyala/fasthttp"
)

const Version = `2.0.8`
const Version = `2.0.9`

// Provider is a generic interface for all archive fetchers
type Provider interface {
Expand Down

0 comments on commit 802222d

Please sign in to comment.