mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Avoid redundant copy when finding item in NavMeshTilesCache
std::make_tuple returns a tuple for types with removed references which makes it to copy arguments. std::tie leaves references.
This commit is contained in:
parent
c38e342c99
commit
6fb7af3b63
@ -17,7 +17,7 @@ namespace DetourNavigator
|
||||
|
||||
++mGetCount;
|
||||
|
||||
const auto tile = mValues.find(std::make_tuple(agentBounds, changedTile, recastMesh));
|
||||
const auto tile = mValues.find(std::tie(agentBounds, changedTile, recastMesh));
|
||||
if (tile == mValues.end())
|
||||
return Value();
|
||||
|
||||
@ -92,7 +92,7 @@ namespace DetourNavigator
|
||||
{
|
||||
const auto& item = mFreeItems.back();
|
||||
|
||||
const auto value = mValues.find(std::make_tuple(item.mAgentBounds, item.mChangedTile, std::cref(item.mRecastMeshData)));
|
||||
const auto value = mValues.find(std::tie(item.mAgentBounds, item.mChangedTile, item.mRecastMeshData));
|
||||
if (value == mValues.end())
|
||||
return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user