diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f9d42ae9..78252f227 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1690,7 +1690,6 @@ set_src(BASE GLOB_RECURSE src/base tl/allocator.h tl/array.h tl/range.h - tl/sorted_array.h tl/threading.h unicode/confusables.cpp unicode/confusables.h @@ -2504,7 +2503,6 @@ if(GTEST_FOUND OR DOWNLOAD_GTEST) secure_random.cpp serverbrowser.cpp serverinfo.cpp - sorted_array.cpp str.cpp strip_path_and_extension.cpp teehistorian.cpp diff --git a/src/base/tl/sorted_array.h b/src/base/tl/sorted_array.h deleted file mode 100644 index b7ae5bd0a..000000000 --- a/src/base/tl/sorted_array.h +++ /dev/null @@ -1,53 +0,0 @@ -/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ -/* If you are missing that file, acquire a complete release at teeworlds.com. */ -#ifndef BASE_TL_SORTED_ARRAY_H -#define BASE_TL_SORTED_ARRAY_H - -#include "base/tl/algorithm.h" -#include "base/tl/array.h" - -template> -class sorted_array : public array -{ - typedef array parent; - - // insert and size is not allowed - int insert(const T &item, typename parent::range r) - { - dbg_break(); - return 0; - } - int set_size(int new_size) - { - dbg_break(); - return 0; - } - -public: - typedef plain_range_sorted range; - - int add(const T &item) - { - return parent::insert(item, partition_binary(all(), item)); - } - - int add_unsorted(const T &item) - { - return parent::add(item); - } - - void sort_range() - { - if(parent::size() > 0) - sort(all()); - } - - /* - Function: all - Returns a sorted range that contains the whole array. - */ - range all() { return range(parent::list, parent::list + parent::num_elements); } - range all() const { return range(parent::list, parent::list + parent::num_elements); } -}; - -#endif // TL_FILE_SORTED_ARRAY_HPP diff --git a/src/test/sorted_array.cpp b/src/test/sorted_array.cpp deleted file mode 100644 index a02edddfa..000000000 --- a/src/test/sorted_array.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#include - -TEST(SortedArray, SortEmptyRange) -{ - sorted_array x; - x.sort_range(); -}