Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-flow-metrics
Commits
e9e2aa6a
Commit
e9e2aa6a
authored
Oct 31, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid allocating for interface conversions on clear
parent
42df1851
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
registry.go
registry.go
+3
-2
No files found.
registry.go
View file @
e9e2aa6a
...
@@ -75,7 +75,8 @@ func (r *MeterRegistry) ForEach(iterFunc func(string, *Meter)) {
...
@@ -75,7 +75,8 @@ func (r *MeterRegistry) ForEach(iterFunc func(string, *Meter)) {
// Clear removes all meters from the registry.
// Clear removes all meters from the registry.
func
(
r
*
MeterRegistry
)
Clear
()
{
func
(
r
*
MeterRegistry
)
Clear
()
{
r
.
ForEach
(
func
(
name
string
,
_meter
*
Meter
)
{
r
.
meters
.
Range
(
func
(
k
,
v
interface
{})
bool
{
r
.
Remove
(
name
)
r
.
meters
.
Delete
(
k
)
return
true
})
})
}
}
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