Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
968f6019
Commit
968f6019
authored
Nov 08, 2018
by
Corey Lin
Committed by
Felix Lange
Nov 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event, event/filter: minor code cleanup (#18061)
parent
503993c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
event_test.go
event/event_test.go
+4
-4
generic_filter.go
event/filter/generic_filter.go
+2
-2
No files found.
event/event_test.go
View file @
968f6019
...
@@ -141,7 +141,7 @@ func TestMuxConcurrent(t *testing.T) {
...
@@ -141,7 +141,7 @@ func TestMuxConcurrent(t *testing.T) {
}
}
}
}
func
emptySubscriber
(
mux
*
TypeMux
,
types
...
interface
{}
)
{
func
emptySubscriber
(
mux
*
TypeMux
)
{
s
:=
mux
.
Subscribe
(
testEvent
(
0
))
s
:=
mux
.
Subscribe
(
testEvent
(
0
))
go
func
()
{
go
func
()
{
for
range
s
.
Chan
()
{
for
range
s
.
Chan
()
{
...
@@ -182,9 +182,9 @@ func BenchmarkPost1000(b *testing.B) {
...
@@ -182,9 +182,9 @@ func BenchmarkPost1000(b *testing.B) {
func
BenchmarkPostConcurrent
(
b
*
testing
.
B
)
{
func
BenchmarkPostConcurrent
(
b
*
testing
.
B
)
{
var
mux
=
new
(
TypeMux
)
var
mux
=
new
(
TypeMux
)
defer
mux
.
Stop
()
defer
mux
.
Stop
()
emptySubscriber
(
mux
,
testEvent
(
0
)
)
emptySubscriber
(
mux
)
emptySubscriber
(
mux
,
testEvent
(
0
)
)
emptySubscriber
(
mux
)
emptySubscriber
(
mux
,
testEvent
(
0
)
)
emptySubscriber
(
mux
)
var
wg
sync
.
WaitGroup
var
wg
sync
.
WaitGroup
poster
:=
func
()
{
poster
:=
func
()
{
...
...
event/filter/generic_filter.go
View file @
968f6019
...
@@ -25,7 +25,7 @@ type Generic struct {
...
@@ -25,7 +25,7 @@ type Generic struct {
// self = registered, f = incoming
// self = registered, f = incoming
func
(
self
Generic
)
Compare
(
f
Filter
)
bool
{
func
(
self
Generic
)
Compare
(
f
Filter
)
bool
{
var
strMatch
,
dataMatch
=
true
,
true
var
strMatch
=
true
filter
:=
f
.
(
Generic
)
filter
:=
f
.
(
Generic
)
if
(
len
(
self
.
Str1
)
>
0
&&
filter
.
Str1
!=
self
.
Str1
)
||
if
(
len
(
self
.
Str1
)
>
0
&&
filter
.
Str1
!=
self
.
Str1
)
||
...
@@ -40,7 +40,7 @@ func (self Generic) Compare(f Filter) bool {
...
@@ -40,7 +40,7 @@ func (self Generic) Compare(f Filter) bool {
}
}
}
}
return
strMatch
&&
dataMatch
return
strMatch
}
}
func
(
self
Generic
)
Trigger
(
data
interface
{})
{
func
(
self
Generic
)
Trigger
(
data
interface
{})
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment