refactor: prefer Sorted variant of MakeFixedFlatSet() (#39537)
perf: prefer Sorted variant of MakeFixedFlatSet()
4660000
says that the sorted version is simpler at compile time because it
can skip MakeFixedFlatSet()'s compile-time dynamic sorting.
This commit is contained in:
parent
8374b9c2ad
commit
213388cd87
3 changed files with 32 additions and 23 deletions
|
@ -54,13 +54,14 @@ namespace {
|
|||
// See https://nodejs.org/api/cli.html#cli_options
|
||||
void ExitIfContainsDisallowedFlags(const std::vector<std::string>& argv) {
|
||||
// Options that are unilaterally disallowed.
|
||||
static constexpr auto disallowed = base::MakeFixedFlatSet<base::StringPiece>({
|
||||
"--enable-fips",
|
||||
"--force-fips",
|
||||
"--openssl-config",
|
||||
"--use-bundled-ca",
|
||||
"--use-openssl-ca",
|
||||
});
|
||||
static constexpr auto disallowed =
|
||||
base::MakeFixedFlatSetSorted<base::StringPiece>({
|
||||
"--enable-fips",
|
||||
"--force-fips",
|
||||
"--openssl-config",
|
||||
"--use-bundled-ca",
|
||||
"--use-openssl-ca",
|
||||
});
|
||||
|
||||
for (const auto& arg : argv) {
|
||||
const auto key = base::StringPiece(arg).substr(0, arg.find('='));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue