chore: use emplace when possible (#37877)

This commit is contained in:
David Sanders 2023-04-10 23:21:03 -07:00 committed by GitHub
parent 3c0c4d5c27
commit 82442239bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View file

@ -106,10 +106,10 @@ UtilityProcessWrapper::UtilityProcessWrapper(
return;
}
if (io_handle == IOHandle::STDOUT) {
fds_to_remap.push_back(std::make_pair(pipe_fd[1], STDOUT_FILENO));
fds_to_remap.emplace_back(pipe_fd[1], STDOUT_FILENO);
stdout_read_fd_ = pipe_fd[0];
} else if (io_handle == IOHandle::STDERR) {
fds_to_remap.push_back(std::make_pair(pipe_fd[1], STDERR_FILENO));
fds_to_remap.emplace_back(pipe_fd[1], STDERR_FILENO);
stderr_read_fd_ = pipe_fd[0];
}
#endif
@ -135,9 +135,9 @@ UtilityProcessWrapper::UtilityProcessWrapper(
return;
}
if (io_handle == IOHandle::STDOUT) {
fds_to_remap.push_back(std::make_pair(devnull, STDOUT_FILENO));
fds_to_remap.emplace_back(devnull, STDOUT_FILENO);
} else if (io_handle == IOHandle::STDERR) {
fds_to_remap.push_back(std::make_pair(devnull, STDERR_FILENO));
fds_to_remap.emplace_back(devnull, STDERR_FILENO);
}
#endif
}