Skip to content

Commit

Permalink
event, event/filter: minor code cleanup (#18061)
Browse files Browse the repository at this point in the history
  • Loading branch information
CoreyLin authored and fjl committed Nov 8, 2018
1 parent 503993c commit 968f601
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions event/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestMuxConcurrent(t *testing.T) {
}
}

func emptySubscriber(mux *TypeMux, types ...interface{}) {
func emptySubscriber(mux *TypeMux) {
s := mux.Subscribe(testEvent(0))
go func() {
for range s.Chan() {
Expand Down Expand Up @@ -182,9 +182,9 @@ func BenchmarkPost1000(b *testing.B) {
func BenchmarkPostConcurrent(b *testing.B) {
var mux = new(TypeMux)
defer mux.Stop()
emptySubscriber(mux, testEvent(0))
emptySubscriber(mux, testEvent(0))
emptySubscriber(mux, testEvent(0))
emptySubscriber(mux)
emptySubscriber(mux)
emptySubscriber(mux)

var wg sync.WaitGroup
poster := func() {
Expand Down
4 changes: 2 additions & 2 deletions event/filter/generic_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Generic struct {

// self = registered, f = incoming
func (self Generic) Compare(f Filter) bool {
var strMatch, dataMatch = true, true
var strMatch = true

filter := f.(Generic)
if (len(self.Str1) > 0 && filter.Str1 != self.Str1) ||
Expand All @@ -40,7 +40,7 @@ func (self Generic) Compare(f Filter) bool {
}
}

return strMatch && dataMatch
return strMatch
}

func (self Generic) Trigger(data interface{}) {
Expand Down

0 comments on commit 968f601

Please sign in to comment.