mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-27 11:36:52 +00:00
Use string_view for canOptimize
This commit is contained in:
parent
a98ce7f76a
commit
3ea3eeb613
1 changed files with 5 additions and 5 deletions
|
@ -778,12 +778,12 @@ namespace Resource
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool canOptimize(const std::string& filename)
|
static bool canOptimize(std::string_view filename)
|
||||||
{
|
{
|
||||||
size_t slashpos = filename.find_last_of("\\/");
|
const std::string_view::size_type slashpos = filename.find_last_of('/');
|
||||||
if (slashpos != std::string::npos && slashpos + 1 < filename.size())
|
if (slashpos != std::string_view::npos && slashpos + 1 < filename.size())
|
||||||
{
|
{
|
||||||
std::string basename = filename.substr(slashpos + 1);
|
const std::string_view basename = filename.substr(slashpos + 1);
|
||||||
// xmesh.nif can not be optimized because there are keyframes added in post
|
// xmesh.nif can not be optimized because there are keyframes added in post
|
||||||
if (!basename.empty() && basename[0] == 'x')
|
if (!basename.empty() && basename[0] == 'x')
|
||||||
return false;
|
return false;
|
||||||
|
@ -796,7 +796,7 @@ namespace Resource
|
||||||
|
|
||||||
// For spell VFX, DummyXX nodes must remain intact. Not adding those to reservedNames to avoid being overly
|
// For spell VFX, DummyXX nodes must remain intact. Not adding those to reservedNames to avoid being overly
|
||||||
// cautious - instead, decide on filename
|
// cautious - instead, decide on filename
|
||||||
if (filename.find("vfx_pattern") != std::string::npos)
|
if (filename.find("vfx_pattern") != std::string_view::npos)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue