1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00

Remove unused Collections::ToArray()

This commit is contained in:
Gymnasiast
2024-10-15 17:43:05 +02:00
parent 0ec76e09d4
commit 449d884434

View File

@@ -9,7 +9,6 @@
#pragma once
#include "Memory.hpp"
#include "String.hpp"
#include <initializer_list>
@@ -78,23 +77,5 @@ namespace OpenRCT2::Collections
collection, item, [ignoreCase](const char* a, const char* b) { return String::Equals(a, b, ignoreCase); });
}
template<typename TCollection> static typename TCollection::value_type* ToArray(const TCollection& collection)
{
size_t count = collection.size();
if (count == 0)
{
return nullptr;
}
auto* items = Memory::AllocateArray<typename TCollection::value_type>(count);
size_t i = 0;
for (const auto& item : collection)
{
items[i] = item;
i++;
}
return items;
}
#pragma endregion
} // namespace OpenRCT2::Collections