Skip to content

Commit ca9fde1

Browse files
In EvalState::concatLists, local variable s -> strings
It deserves a better name. Co-Authored-By: Aspen Smith <[email protected]>
1 parent 0ba1aa3 commit ca9fde1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libexpr/eval.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,7 @@ void EvalState::concatLists(
20212021
void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
20222022
{
20232023
NixStringContext context;
2024-
std::vector<BackedStringView> s;
2024+
std::vector<BackedStringView> strings;
20252025
size_t sSize = 0;
20262026
NixInt n{0};
20272027
NixFloat nf = 0;
@@ -2032,7 +2032,7 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
20322032
const auto str = [&] {
20332033
std::string result;
20342034
result.reserve(sSize);
2035-
for (const auto & part : s)
2035+
for (const auto & part : strings)
20362036
result += *part;
20372037
return result;
20382038
};
@@ -2042,7 +2042,7 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
20422042
const auto c_str = [&] {
20432043
char * result = allocString(sSize + 1);
20442044
char * tmp = result;
2045-
for (const auto & part : s) {
2045+
for (const auto & part : strings) {
20462046
memcpy(tmp, part->data(), part->size());
20472047
tmp += part->size();
20482048
}
@@ -2097,15 +2097,15 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
20972097
.withFrame(env, *this)
20982098
.debugThrow();
20992099
} else {
2100-
if (s.empty())
2101-
s.reserve(es.size());
2100+
if (strings.empty())
2101+
strings.reserve(es.size());
21022102
/* skip canonization of first path, which would only be not
21032103
canonized in the first place if it's coming from a ./${foo} type
21042104
path */
21052105
auto part = state.coerceToString(
21062106
i_pos, vTmp, context, "while evaluating a path segment", false, firstType == nString, !first);
21072107
sSize += part->size();
2108-
s.emplace_back(std::move(part));
2108+
strings.emplace_back(std::move(part));
21092109
}
21102110

21112111
first = false;

0 commit comments

Comments
 (0)