mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
event: don't use me, this, self as receiver names
This commit is contained in:
parent
e4d249db6c
commit
c7612bdc30
1 changed files with 8 additions and 8 deletions
|
|
@ -23,18 +23,18 @@ type Generic struct {
|
||||||
Fn func(data interface{})
|
Fn func(data interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// self = registered, f = incoming
|
// g = registered, f = incoming
|
||||||
func (self Generic) Compare(f Filter) bool {
|
func (g Generic) Compare(f Filter) bool {
|
||||||
var strMatch, dataMatch = true, true
|
var strMatch, dataMatch = true, true
|
||||||
|
|
||||||
filter := f.(Generic)
|
filter := f.(Generic)
|
||||||
if (len(self.Str1) > 0 && filter.Str1 != self.Str1) ||
|
if (len(g.Str1) > 0 && filter.Str1 != g.Str1) ||
|
||||||
(len(self.Str2) > 0 && filter.Str2 != self.Str2) ||
|
(len(g.Str2) > 0 && filter.Str2 != g.Str2) ||
|
||||||
(len(self.Str3) > 0 && filter.Str3 != self.Str3) {
|
(len(g.Str3) > 0 && filter.Str3 != g.Str3) {
|
||||||
strMatch = false
|
strMatch = false
|
||||||
}
|
}
|
||||||
|
|
||||||
for k := range self.Data {
|
for k := range g.Data {
|
||||||
if _, ok := filter.Data[k]; !ok {
|
if _, ok := filter.Data[k]; !ok {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
@ -43,6 +43,6 @@ func (self Generic) Compare(f Filter) bool {
|
||||||
return strMatch && dataMatch
|
return strMatch && dataMatch
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self Generic) Trigger(data interface{}) {
|
func (g Generic) Trigger(data interface{}) {
|
||||||
self.Fn(data)
|
g.Fn(data)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue