Skip to content

Commit 0f15e9d

Browse files
committed
src: collapsed the scope of local variables into the loop
1 parent b4280ef commit 0f15e9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_dotenv.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ MaybeLocal<Object> Dotenv::ToObject(Environment* env) const {
8787
EscapableHandleScope scope(env->isolate());
8888
Local<Object> result = Object::New(env->isolate());
8989

90-
Local<Value> name;
91-
Local<Value> val;
9290
auto context = env->context();
9391

9492
for (const auto& entry : store_) {
93+
Local<Value> name;
94+
Local<Value> val;
9595
if (!ToV8Value(context, entry.first).ToLocal(&name) ||
9696
!ToV8Value(context, entry.second).ToLocal(&val) ||
9797
result->Set(context, name, val).IsNothing()) {

0 commit comments

Comments
 (0)