Skip to content

Commit 5168ceb

Browse files
committed
src: collapse local var scope in loop
1 parent 1e3bdc5 commit 5168ceb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_dotenv.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ std::vector<Dotenv::env_file_data> Dotenv::GetDataFromArgs(
6767
}
6868

6969
Maybe<void> Dotenv::SetEnvironment(node::Environment* env) {
70+
Local<Value> name;
71+
Local<Value> val;
7072
auto context = env->context();
7173
auto env_vars = env->env_vars();
7274

7375
for (const auto& entry : store_) {
7476
auto existing = env_vars->Get(entry.first.data());
7577
if (!existing.has_value()) {
76-
Local<Value> name;
77-
Local<Value> val;
7878
if (!ToV8Value(context, entry.first).ToLocal(&name) ||
7979
!ToV8Value(context, entry.second).ToLocal(&val)) {
8080
return Nothing<void>();

0 commit comments

Comments
 (0)