Skip to content

Commit a75d513

Browse files
committed
fix: avoid copying of context
1 parent 7338a40 commit a75d513

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ LoadResult GoLanguageModule::OnPluginLoad(PluginHandle plugin) {
132132
return ErrorData{ std::format("Not supported plugin api {}, max supported {}", resultVersion, kApiVersion) };
133133
}
134134

135-
auto [hasUpdate, hasStart, hasEnd, _] = contextFunc ? *(contextFunc()) : PluginContext{};
135+
const auto& [hasUpdate, hasStart, hasEnd, _] = contextFunc ? *(contextFunc()) : PluginContext{};
136136

137137
auto data = _assemblies.emplace_back(std::make_unique<AssemblyHolder>(std::move(assembly), updateFunc, startFunc, endFunc, contextFunc, callFunc)).get();
138138
return LoadResultData{ std::move(methods), data, { hasUpdate, hasStart, hasEnd, !exportedMethods.empty() } };

0 commit comments

Comments
 (0)