mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-08 14:50:06 +00:00
Normalize module-path
Modules indipendant of the path, should only be evaluated once.
This commit is contained in:
1 parent
c6d42ebbd5
commit
32ef4fd0fa
4 files changed
+21
-9
No files matched your search
@@ -58,7 +58,8 @@ namespace
|
||||
[[nodiscard]] JSObject* CompileModule(const ScriptRequest& rq, ModuleLoader::RegistryType& registry,
|
||||
const VfsPath& filePath)
|
||||
{
|
||||
const auto insertResult = registry.try_emplace(filePath, rq, filePath);
|
||||
const VfsPath normalizedPath{filePath.fileSystemPath().lexically_normal().generic_string()};
|
||||
const auto insertResult = registry.try_emplace(normalizedPath, rq, normalizedPath);
|
||||
return std::get<1>(*std::get<0>(insertResult)).m_ModuleObject;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user