Skip to content

Commit 4fe91b3

Browse files
GODRIVER-2654 Remove direct slice assignment (#1129)
1 parent 1c35f30 commit 4fe91b3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

x/mongo/driver/topology/topology.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -564,14 +564,10 @@ func (t *Topology) selectServerFromDescription(desc description.Topology,
564564
allowedIndexes = append(allowedIndexes, i)
565565
}
566566
}
567-
var allowed []description.Server
568-
if len(allowedIndexes) == len(desc.Servers) {
569-
allowed = desc.Servers
570-
} else {
571-
allowed = make([]description.Server, len(allowedIndexes))
572-
for i, idx := range allowedIndexes {
573-
allowed[i] = desc.Servers[idx]
574-
}
567+
568+
allowed := make([]description.Server, len(allowedIndexes))
569+
for i, idx := range allowedIndexes {
570+
allowed[i] = desc.Servers[idx]
575571
}
576572

577573
suitable, err := selectionState.selector.SelectServer(desc, allowed)

0 commit comments

Comments
 (0)