From 2b3370228bbb98cabb6207caddbd45a421830516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Sun, 12 Aug 2018 13:04:00 +0100 Subject: [PATCH] Remove the last usage of Math.hpp --- src/openrct2/core/Math.hpp | 27 -------------------- src/openrct2/scenario/ScenarioRepository.cpp | 6 +++-- 2 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 src/openrct2/core/Math.hpp diff --git a/src/openrct2/core/Math.hpp b/src/openrct2/core/Math.hpp deleted file mode 100644 index 98579caf5e..0000000000 --- a/src/openrct2/core/Math.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014-2018 OpenRCT2 developers - * - * For a complete list of all authors, please refer to contributors.md - * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 - * - * OpenRCT2 is licensed under the GNU General Public License version 3. - *****************************************************************************/ - -#pragma once - -#include - -/** - * Common mathematical functions. - */ -namespace Math -{ - template static T Sign(T x) - { - if (x < 0) - return -1; - if (x > 0) - return 1; - return 0; - } -} // namespace Math diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 21325540b5..ba89ef0734 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -18,7 +18,6 @@ #include "../core/File.h" #include "../core/FileIndex.hpp" #include "../core/FileStream.hpp" -#include "../core/Math.hpp" #include "../core/Path.hpp" #include "../core/String.hpp" #include "../core/Util.hpp" @@ -48,7 +47,10 @@ static int32_t ScenarioCategoryCompare(int32_t categoryA, int32_t categoryB) return -1; if (categoryB == SCENARIO_CATEGORY_BUILD_YOUR_OWN) return 1; - return Math::Sign(categoryA - categoryB); + if (categoryA < categoryB) + return -1; + else + return 1; } static int32_t scenario_index_entry_CompareByCategory(const scenario_index_entry& entryA, const scenario_index_entry& entryB)