mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-30 17:06:40 +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
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue