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.
LTO-timing^2
elsid 3 years ago
parent c38e342c99
commit 6fb7af3b63
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -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…
Cancel
Save