MCPcopy Create free account
hub / github.com/ElementsProject/elements / OnlyHasDefaultSectionSetting

Function OnlyHasDefaultSectionSetting

src/util/settings.cpp:224–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224bool OnlyHasDefaultSectionSetting(const Settings& settings, const std::string& section, const std::string& name)
225{
226 bool has_default_section_setting = false;
227 bool has_other_setting = false;
228 MergeSettings(settings, section, name, [&](SettingsSpan span, Source source) {
229 if (span.empty()) return;
230 else if (source == Source::CONFIG_FILE_DEFAULT_SECTION) has_default_section_setting = true;
231 else has_other_setting = true;
232 });
233 // If a value is set in the default section and not explicitly overwritten by the
234 // user on the command line or in a different section, then we want to enable
235 // warnings about the value being ignored.
236 return has_default_section_setting && !has_other_setting;
237}
238
239SettingsSpan::SettingsSpan(const std::vector<SettingsValue>& vec) noexcept : SettingsSpan(vec.data(), vec.size()) {}
240const SettingsValue* SettingsSpan::begin() const { return data + negated(); }

Callers 3

BOOST_FIXTURE_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85

Calls 2

MergeSettingsFunction · 0.85
emptyMethod · 0.45

Tested by 2

BOOST_FIXTURE_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68