Commit d32a746c by Copybara-Service

Merge pull request #1390 from AtariDreams:default

PiperOrigin-RevId: 510549728
Change-Id: I4447197b56dc76aaf4dd4e78671de247af2a91e8
parents a0f9b465 6089a040
...@@ -121,7 +121,7 @@ void CrcCordState::Poison() { ...@@ -121,7 +121,7 @@ void CrcCordState::Poison() {
} }
} else { } else {
// Add a fake corrupt chunk. // Add a fake corrupt chunk.
rep->prefix_crc.push_back(PrefixCrc(0, crc32c_t{1})); rep->prefix_crc.emplace_back(0, crc32c_t{1});
} }
} }
......
...@@ -130,7 +130,7 @@ class FlagHelpPrettyPrinter { ...@@ -130,7 +130,7 @@ class FlagHelpPrettyPrinter {
for (auto line : absl::StrSplit(str, absl::ByAnyChar("\n\r"))) { for (auto line : absl::StrSplit(str, absl::ByAnyChar("\n\r"))) {
if (!tokens.empty()) { if (!tokens.empty()) {
// Keep line separators in the input string. // Keep line separators in the input string.
tokens.push_back("\n"); tokens.emplace_back("\n");
} }
for (auto token : for (auto token :
absl::StrSplit(line, absl::ByAnyChar(" \t"), absl::SkipEmpty())) { absl::StrSplit(line, absl::ByAnyChar(" \t"), absl::SkipEmpty())) {
......
...@@ -190,7 +190,7 @@ bool ArgsList::ReadFromFlagfile(const std::string& flag_file_name) { ...@@ -190,7 +190,7 @@ bool ArgsList::ReadFromFlagfile(const std::string& flag_file_name) {
// This argument represents fake argv[0], which should be present in all arg // This argument represents fake argv[0], which should be present in all arg
// lists. // lists.
args_.push_back(""); args_.emplace_back("");
std::string line; std::string line;
bool success = true; bool success = true;
...@@ -212,7 +212,7 @@ bool ArgsList::ReadFromFlagfile(const std::string& flag_file_name) { ...@@ -212,7 +212,7 @@ bool ArgsList::ReadFromFlagfile(const std::string& flag_file_name) {
break; break;
} }
args_.push_back(std::string(stripped)); args_.emplace_back(stripped);
continue; continue;
} }
...@@ -367,7 +367,7 @@ bool ReadFlagsFromEnv(const std::vector<std::string>& flag_names, ...@@ -367,7 +367,7 @@ bool ReadFlagsFromEnv(const std::vector<std::string>& flag_names,
// This argument represents fake argv[0], which should be present in all arg // This argument represents fake argv[0], which should be present in all arg
// lists. // lists.
args.push_back(""); args.emplace_back("");
for (const auto& flag_name : flag_names) { for (const auto& flag_name : flag_names) {
// Avoid infinite recursion. // Avoid infinite recursion.
...@@ -680,7 +680,7 @@ std::vector<char*> ParseCommandLineImpl(int argc, char* argv[], ...@@ -680,7 +680,7 @@ std::vector<char*> ParseCommandLineImpl(int argc, char* argv[],
std::vector<std::string> flagfile_value; std::vector<std::string> flagfile_value;
std::vector<ArgsList> input_args; std::vector<ArgsList> input_args;
input_args.push_back(ArgsList(argc, argv)); input_args.emplace_back(argc, argv);
std::vector<char*> output_args; std::vector<char*> output_args;
std::vector<char*> positional_args; std::vector<char*> positional_args;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment