From c8c02769760cce7d5e569ab8bfd9304d527b19ac Mon Sep 17 00:00:00 2001 From: Joseph Walton-Rivers <joseph@walton-rivers.uk> Date: Sat, 20 Aug 2022 12:03:24 +0100 Subject: [PATCH] remove unused header --- include/fggl/ecs3/utils.hpp | 50 ------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 include/fggl/ecs3/utils.hpp diff --git a/include/fggl/ecs3/utils.hpp b/include/fggl/ecs3/utils.hpp deleted file mode 100644 index fef865b..0000000 --- a/include/fggl/ecs3/utils.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of FGGL. - * - * FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any - * later version. - * - * FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License along with FGGL. - * If not, see <https://www.gnu.org/licenses/>. - */ - -#ifndef FGGL_ECS3_UTILS_HPP -#define FGGL_ECS3_UTILS_HPP - -#include <cstddef> - -namespace fggl::utils { - - template<typename T> - std::size_t search(const T *data, const std::size_t size, const T &v) { - // empty list == not found - if (size == 0) { - return size; - } - - std::size_t left = 0; - std::size_t right = size - 1; - while (left <= right) { - std::size_t m = (left + right) / 2; - if (data[m] == v) { - return m; - } else if (v < data[m]) { - if (m == 0) { - return size; - } - right = m - 1; - } else { - left = m + 1; - } - } - - return size; - } - -} - -#endif -- GitLab