mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Use BattleHex as const ref wherever possible
Minor Fixes Drop unused function from BattleHexArray
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
BattleHex BattleHex::getClosestTile(BattleSide side, BattleHex initialPos, const BattleHexArray & hexes)
|
||||
BattleHex BattleHex::getClosestTile(BattleSide side, const BattleHex & initialPos, const BattleHexArray & hexes)
|
||||
{
|
||||
if(hexes.empty())
|
||||
return BattleHex();
|
||||
@@ -22,7 +22,7 @@ BattleHex BattleHex::getClosestTile(BattleSide side, BattleHex initialPos, const
|
||||
int closestDistance = std::numeric_limits<int>::max();
|
||||
BattleHexArray closestTiles;
|
||||
|
||||
for(auto hex : hexes)
|
||||
for(const auto & hex : hexes)
|
||||
{
|
||||
int distance = initialHex.getDistance(initialHex, hex);
|
||||
if(distance < closestDistance)
|
||||
|
||||
Reference in New Issue
Block a user