MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / find_option_match

Function find_option_match

src/framework/runtime/options.cpp:83–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81} // namespace
82
83std::optional<OptionMatch> find_option_match(
84 const std::unordered_map<std::string, std::string> & options,
85 std::initializer_list<std::string_view> keys) {
86 std::optional<OptionMatch> match;
87 for (const std::string_view key : keys) {
88 const auto it = options.find(std::string(key));
89 if (it != options.end() && !it->second.empty()) {
90 if (match.has_value()) {
91 if (match->value != it->second) {
92 throw std::runtime_error(
93 "conflicting option values for " + match->key + " and " + std::string(key));
94 }
95 continue;
96 }
97 match = OptionMatch{std::string(key), it->second};
98 }
99 }
100 return match;
101}
102
103std::optional<std::string> find_option(
104 const std::unordered_map<std::string, std::string> & options,

Callers 13

find_optionFunction · 0.85
parse_int_optionFunction · 0.85
parse_float_optionFunction · 0.85
parse_u32_optionFunction · 0.85
parse_u64_optionFunction · 0.85
parse_i64_optionFunction · 0.85
parse_size_mb_optionFunction · 0.85
reject_enabled_denoiseFunction · 0.85
reject_denoiser_optionFunction · 0.85

Calls 4

stringFunction · 0.50
findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected