summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/kill_sessions_remote.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/commands/kill_sessions_remote.cpp')
-rw-r--r--src/mongo/s/commands/kill_sessions_remote.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/s/commands/kill_sessions_remote.cpp b/src/mongo/s/commands/kill_sessions_remote.cpp
index d9b5ce26ccf..0bda8eacf61 100644
--- a/src/mongo/s/commands/kill_sessions_remote.cpp
+++ b/src/mongo/s/commands/kill_sessions_remote.cpp
@@ -119,9 +119,11 @@ SessionKiller::Result killSessionsRemote(OperationContext* opCtx,
// Generate the kill command.
KillAllSessionsByPatternCmd cmd;
- cmd.setKillAllSessionsByPattern(std::vector<KillAllSessionsByPattern>{
- matcher.getPatterns().begin(), matcher.getPatterns().end()});
-
+ std::vector<KillAllSessionsByPattern> patterns;
+ for (auto& item : matcher.getPatterns()) {
+ patterns.push_back(std::move(item.pattern));
+ }
+ cmd.setKillAllSessionsByPattern(std::move(patterns));
return parallelExec(opCtx, cmd.toBSON(), urbg);
}