Skip to content

Commit

Permalink
Minor refactoring CScriptRuntimeInfo.h
Browse files Browse the repository at this point in the history
  • Loading branch information
libragliese581 committed Feb 18, 2025
1 parent e13f8ab commit 58ad42c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions module/src/CScriptRuntimeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class CScriptRuntimeInfo

public:
v8::Isolate* GetIsolate() {
if (!isolates.Find(std::this_thread::get_id()))
auto isolate = isolates.GetElement(std::this_thread::get_id());
if (!isolate)
{
Log::Colored << "NOT FOUND" << std::this_thread::get_id() << Log::Endl;
v8::Isolate* isolate = MakeIsolate();
isolates.Insert(std::this_thread::get_id(), isolate);
return isolate;
v8::Isolate* newIsolate = MakeIsolate();
isolates.Insert(std::this_thread::get_id(), newIsolate);
return newIsolate;
}
return isolates.GetElement(std::this_thread::get_id()).value_or(nullptr);
return *isolate;
}

v8::Isolate* MakeIsolate()
Expand Down

0 comments on commit 58ad42c

Please sign in to comment.