From 1841d93ccbe5792a17f5b9a22e65ec898c7c2668 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 19:04:08 +0100 Subject: style(3p/nix): Add braces around single-line for-loops These were not caught by the previous clang-tidy invocation, but were instead sorted out using amber[0] as such: ambr --regex 'for (\(.+\))\s([a-z].*;)' 'for $1 { $2 }' [0]: https://github.com/dalance/amber --- third_party/nix/src/libutil/config.cc | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'third_party/nix/src/libutil/config.cc') diff --git a/third_party/nix/src/libutil/config.cc b/third_party/nix/src/libutil/config.cc index dbb703750f36..0b01f6ae8a83 100644 --- a/third_party/nix/src/libutil/config.cc +++ b/third_party/nix/src/libutil/config.cc @@ -61,7 +61,9 @@ void AbstractConfig::warnUnknownSettings() { void AbstractConfig::reapplyUnknownSettings() { auto unknownSettings2 = std::move(unknownSettings); - for (auto& s : unknownSettings2) set(s.first, s.second); + for (auto& s : unknownSettings2) { + set(s.first, s.second); + } } void Config::getSettings(std::map& res, @@ -138,7 +140,9 @@ void AbstractConfig::applyConfigFile(const Path& path) { } void Config::resetOverriden() { - for (auto& s : _settings) s.second.setting->overriden = false; + for (auto& s : _settings) { + s.second.setting->overriden = false; + } } void Config::toJSON(JSONObject& out) { @@ -250,7 +254,9 @@ std::string BaseSetting::to_string() { template <> void BaseSetting::toJSON(JSONPlaceholder& out) { JSONList list(out.list()); - for (auto& s : value) list.elem(s); + for (auto& s : value) { + list.elem(s); + } } template <> @@ -266,7 +272,9 @@ std::string BaseSetting::to_string() { template <> void BaseSetting::toJSON(JSONPlaceholder& out) { JSONList list(out.list()); - for (auto& s : value) list.elem(s); + for (auto& s : value) { + list.elem(s); + } } template class BaseSetting; @@ -308,11 +316,15 @@ void GlobalConfig::getSettings(std::map& res, } void GlobalConfig::resetOverriden() { - for (auto& config : *configRegistrations) config->resetOverriden(); + for (auto& config : *configRegistrations) { + config->resetOverriden(); + } } void GlobalConfig::toJSON(JSONObject& out) { - for (auto& config : *configRegistrations) config->toJSON(out); + for (auto& config : *configRegistrations) { + config->toJSON(out); + } } void GlobalConfig::convertToArgs(Args& args, const std::string& category) { -- cgit 1.4.1