mirror of
https://github.com/vcmi/vcmi.git
synced 2026-05-22 09:55:17 +02:00
Use containers with pre-allocations to improve pathfinding speed
This commit is contained in:
@@ -320,11 +320,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);
|
||||
|
||||
const AIPathNode * srcNode = getAINode(source.node);
|
||||
|
||||
Reference in New Issue
Block a user