good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
968f6019
Commit
968f6019
authored
Nov 8, 2018
by
Corey Lin
Committed by
Felix Lange
Nov 8, 2018
Browse files
Options
Downloads
Patches
Plain Diff
event, event/filter: minor code cleanup (#18061)
parent
503993c8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
event/event_test.go
+4
-4
4 additions, 4 deletions
event/event_test.go
event/filter/generic_filter.go
+2
-2
2 additions, 2 deletions
event/filter/generic_filter.go
with
6 additions
and
6 deletions
event/event_test.go
+
4
−
4
View file @
968f6019
...
...
@@ -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
()
{
...
...
@@ -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
()
{
...
...
This diff is collapsed.
Click to expand it.
event/filter/generic_filter.go
+
2
−
2
View file @
968f6019
...
...
@@ -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
)
||
...
...
@@ -40,7 +40,7 @@ func (self Generic) Compare(f Filter) bool {
}
}
return
strMatch
&&
dataMatch
return
strMatch
}
func
(
self
Generic
)
Trigger
(
data
interface
{})
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment