Commits

Bart van Strien committed 3d89b09

Only retrieve the filesystem instance once while walking the require path

Comments (0)

Files changed (1)

src/modules/filesystem/wrap_Filesystem.cpp

 			c = '/';
 	}
 
+	auto *inst = instance();
 	for (std::string element : requirePath)
 	{
 		size_t pos = element.find('?');
 			continue;
 
 		element.replace(pos, 1, modulename);
-		if (instance()->isFile(element.c_str()))
+		if (inst->isFile(element.c_str()))
 		{
 			lua_pop(L, 1);
 			lua_pushstring(L, element.c_str());