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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user