Skip to content

Commit 588c970

Browse files
committed
PMM-9870 fix linter.
1 parent e2c19fb commit 588c970

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exporter/common.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func makeExcludeFilter(exclude []string) *primitive.E {
106106
if len(exclude) == 0 {
107107
return nil
108108
}
109-
var filterExpressions []bson.D
109+
filterExpressions := make([]bson.D, 0, len(exclude))
110110
for _, dbname := range exclude {
111111
filterExpressions = append(filterExpressions,
112112
bson.D{{Key: "name", Value: bson.D{{Key: "$ne", Value: dbname}}}},
@@ -117,12 +117,12 @@ func makeExcludeFilter(exclude []string) *primitive.E {
117117
}
118118

119119
func makeDBsFilter(filterInNamespaces []string) *primitive.E {
120-
filterExpressions := []bson.D{}
121120

122121
nss := removeEmptyStrings(filterInNamespaces)
123122
if len(nss) == 0 {
124123
return nil
125124
}
125+
filterExpressions := make([]bson.D, 0, len(nss))
126126
for _, namespace := range nss {
127127
parts := strings.Split(namespace, ".")
128128
filterExpressions = append(filterExpressions,

0 commit comments

Comments
 (0)