Skip to content

Commit

Permalink
Add Equal method to preloadlist.Entry struct (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
nharper authored Sep 11, 2024
1 parent 8b52744 commit cc9e2f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chromium/preloadlist/preloadlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ type Entry struct {
Policy PolicyType `json:"policy"`
}

// Equal checks if Entry e is equal to Entry e2 using == to compare all fields.
func (e Entry) Equal(e2 Entry) bool {
return e.Name == e2.Name && e.Mode == e2.Mode && e.IncludeSubDomains == e2.IncludeSubDomains && e.Policy == e2.Policy
}

// IndexedEntries is case-insensitive index of
// the entries from the given PreloadList.
type IndexedEntries struct {
Expand Down

0 comments on commit cc9e2f8

Please sign in to comment.