1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Use containers with pre-allocations to improve pathfinding speed

This commit is contained in:
Ivan Savenko
2024-07-03 18:06:56 +00:00
parent 24b77b0972
commit 40f17d654d
5 changed files with 29 additions and 22 deletions

View File

@@ -162,10 +162,9 @@ void AINodeStorage::calculateNeighbours(
const PathfinderConfig * pathfinderConfig,
const CPathfinderHelper * pathfinderHelper)
{
std::vector<int3> accessibleNeighbourTiles;
NeighbourTilesVector accessibleNeighbourTiles;
result.clear();
accessibleNeighbourTiles.reserve(8);
pathfinderHelper->calculateNeighbourTiles(accessibleNeighbourTiles, source);