summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorskidd13 <skidd13@openttd.org>2007-11-20 12:57:24 +0000
committerskidd13 <skidd13@openttd.org>2007-11-20 12:57:24 +0000
commitb8885630aa9942ea924ffb6eeabc266140485435 (patch)
tree487a548f1b88867f43c97812272e16f5a70337bf /src/map.cpp
parent5c31a973a1dae47f351d4dc9e0451b3341c400f8 (diff)
downloadopenttd-b8885630aa9942ea924ffb6eeabc266140485435.tar.xz
(svn r11483) -Codechange: Replace codeparts with functions that do the same to increase readability
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 00e155c04..7035f955c 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -218,7 +218,7 @@ uint DistanceMax(TileIndex t0, TileIndex t1)
{
const uint dx = delta(TileX(t0), TileX(t1));
const uint dy = delta(TileY(t0), TileY(t1));
- return dx > dy ? dx : dy;
+ return max(dx, dy);
}
@@ -248,9 +248,9 @@ uint DistanceFromEdge(TileIndex tile)
const uint yl = TileY(tile);
const uint xh = MapSizeX() - 1 - xl;
const uint yh = MapSizeY() - 1 - yl;
- const uint minl = xl < yl ? xl : yl;
- const uint minh = xh < yh ? xh : yh;
- return minl < minh ? minl : minh;
+ const uint minl = min(xl, yl);
+ const uint minh = min(xh, yh);
+ return min(minl, minh);
}
/*!