Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotwutingfeng committed Apr 21, 2022
1 parent a9ec46c commit a56e054
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fasttld.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (f *FastTLD) Extract(e URLParams) *ExtractResult {
maybePort string
invalidPort bool
)
if hasPort := afterHost[0] == ':'; hasPort {
if afterHost[0] == ':' {
if pathStartIndex == -1 {
maybePort = afterHost[1:]
} else {
Expand Down Expand Up @@ -222,9 +222,8 @@ func (f *FastTLD) Extract(e URLParams) *ExtractResult {

labels := strings.Split(netloc, ".")

var node *trie
// define the root node
node = f.TldTrie
node := f.TldTrie

var lenSuffix int
var suffixCharCount int
Expand All @@ -244,10 +243,9 @@ func (f *FastTLD) Extract(e URLParams) *ExtractResult {
if len(val.matches) == 0 {
urlParts.Domain = labels[idx-1]
break
} else {
node = val
continue
}
node = val
continue
}
}

Expand Down

0 comments on commit a56e054

Please sign in to comment.