Codechange: Use std::swap() instead of Swap() (#13883)

This commit is contained in:
2025-03-24 23:47:34 +00:00
committed by GitHub
parent 8a53ccf8f1
commit 79ef4e98fe
17 changed files with 37 additions and 50 deletions

View File

@@ -793,7 +793,7 @@ void EndSpriteCombine()
*/
static bool IsInRangeInclusive(int begin, int end, int check)
{
if (begin > end) Swap(begin, end);
if (begin > end) std::swap(begin, end);
return begin <= check && check <= end;
}
@@ -2672,8 +2672,8 @@ void UpdateTileSelection()
if (_thd.IsDraggingDiagonal()) {
new_diagonal = true;
} else {
if (x1 >= x2) Swap(x1, x2);
if (y1 >= y2) Swap(y1, y2);
if (x1 >= x2) std::swap(x1, x2);
if (y1 >= y2) std::swap(y1, y2);
}
_thd.new_pos.x = x1;
_thd.new_pos.y = y1;
@@ -2936,7 +2936,7 @@ static int CalcHeightdiff(HighLightStyle style, uint distance, TileIndex start_t
uint h0, h1; // Start height and end height.
if (start_tile == end_tile) return 0;
if (swap) Swap(start_tile, end_tile);
if (swap) std::swap(start_tile, end_tile);
switch (style & HT_DRAG_MASK) {
case HT_RECT:
@@ -3007,7 +3007,7 @@ static int CalcHeightdiff(HighLightStyle style, uint distance, TileIndex start_t
}
}
if (swap) Swap(h0, h1);
if (swap) std::swap(h0, h1);
return (int)(h1 - h0) * TILE_HEIGHT_STEP;
}