style(3p/nix): Add braces around single-line conditionals
These were not caught by the previous clang-tidy invocation, but were
instead sorted out using amber[0] as such:
ambr --regex 'if (\(.+\))\s([a-z].*;)' 'if $1 { $2 }'
[0]: https://github.com/dalance/amber
This commit is contained in:
parent
c6a31838cd
commit
867055133d
97 changed files with 2223 additions and 753 deletions
12
third_party/nix/src/libexpr/attr-path.cc
vendored
12
third_party/nix/src/libexpr/attr-path.cc
vendored
|
|
@ -19,14 +19,18 @@ static Strings parseAttrPath(const string& s) {
|
|||
if (i == s.end())
|
||||
throw Error(format("missing closing quote in selection path '%1%'") %
|
||||
s);
|
||||
if (*i == '"') break;
|
||||
if (*i == '"') {
|
||||
break;
|
||||
}
|
||||
cur.push_back(*i++);
|
||||
}
|
||||
} else
|
||||
cur.push_back(*i);
|
||||
++i;
|
||||
}
|
||||
if (!cur.empty()) res.push_back(cur);
|
||||
if (!cur.empty()) {
|
||||
res.push_back(cur);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +48,9 @@ Value* findAlongAttrPath(EvalState& state, const string& attrPath,
|
|||
/* Is i an index (integer) or a normal attribute name? */
|
||||
enum { apAttr, apIndex } apType = apAttr;
|
||||
unsigned int attrIndex;
|
||||
if (string2Int(attr, attrIndex)) apType = apIndex;
|
||||
if (string2Int(attr, attrIndex)) {
|
||||
apType = apIndex;
|
||||
}
|
||||
|
||||
/* Evaluate the expression. */
|
||||
Value* vNew = state.allocValue();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue