Remove <algorithm> include from Location.hpp (#21993)

See #21947 for methodology

528-372=156 `#include <algorithm>`s fewer
This commit is contained in:
Michał Janiszewski 2024-05-09 13:54:40 +02:00 committed by GitHub
parent 613d60b446
commit 24a2db9fc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 15 additions and 4 deletions

View File

@ -11,6 +11,7 @@
#include "Theme.h"
#include <algorithm>
#include <cstring>
#include <openrct2/Context.h>
#include <openrct2/Version.h>

View File

@ -7,6 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include <algorithm>
#include <openrct2-ui/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Context.h>

View File

@ -7,6 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include <algorithm>
#include <openrct2-ui/interface/Dropdown.h>
#include <openrct2-ui/interface/LandTool.h>
#include <openrct2-ui/interface/Widget.h>

View File

@ -7,6 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include <algorithm>
#include <openrct2-ui/interface/LandTool.h>
#include <openrct2-ui/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
@ -15,6 +16,7 @@
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/world/Scenery.h>
namespace OpenRCT2::Ui::Windows
{
enum WindowSceneryScatterWidgetIdx

View File

@ -7,6 +7,7 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include <algorithm>
#include <openrct2-ui/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Context.h>

View File

@ -27,6 +27,8 @@
#include "../world/TileElementsView.h"
#include "../world/Wall.h"
#include <algorithm>
using namespace OpenRCT2;
FootpathPlaceAction::FootpathPlaceAction(

View File

@ -12,8 +12,6 @@
#include "../common.h"
#include "../util/Math.hpp"
#include <algorithm>
constexpr int16_t LOCATION_NULL = -32768;
constexpr int32_t COORDS_XY_STEP = 32;
@ -810,9 +808,14 @@ struct MapRange : public RectRange<CoordsXY>
constexpr MapRange Normalise() const
{
// Don't use std::min/max, as they require <algorithm>, one of C++'s heaviest
// in this very common header.
auto result = MapRange(
std::min(GetLeft(), GetRight()), std::min(GetTop(), GetBottom()), std::max(GetLeft(), GetRight()),
std::max(GetTop(), GetBottom()));
GetLeft() < GetRight() ? GetLeft() : GetRight(), // min
GetTop() < GetBottom() ? GetTop() : GetBottom(), // min
GetLeft() > GetRight() ? GetLeft() : GetRight(), // max
GetTop() > GetBottom() ? GetTop() : GetBottom() // max
);
return result;
}
};