Removed unused functions VmaQuickSort, VmaQuickSortPartition

Closes #262. Thanks @laurelkeys !
This commit is contained in:
Adam Sawicki 2022-05-11 12:37:14 +02:00
parent 71b4c18344
commit 0bbde1750e

View File

@ -3377,44 +3377,6 @@ static inline bool VmaStrIsEmpty(const char* pStr)
return pStr == VMA_NULL || *pStr == '\0';
}
#ifndef VMA_SORT
template<typename Iterator, typename Compare>
Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)
{
Iterator centerValue = end; --centerValue;
Iterator insertIndex = beg;
for (Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex)
{
if (cmp(*memTypeIndex, *centerValue))
{
if (insertIndex != memTypeIndex)
{
VMA_SWAP(*memTypeIndex, *insertIndex);
}
++insertIndex;
}
}
if (insertIndex != centerValue)
{
VMA_SWAP(*insertIndex, *centerValue);
}
return insertIndex;
}
template<typename Iterator, typename Compare>
void VmaQuickSort(Iterator beg, Iterator end, Compare cmp)
{
if (beg < end)
{
Iterator it = VmaQuickSortPartition<Iterator, Compare>(beg, end, cmp);
VmaQuickSort<Iterator, Compare>(beg, it, cmp);
VmaQuickSort<Iterator, Compare>(it + 1, end, cmp);
}
}
#define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)
#endif // VMA_SORT
/*
Returns true if two memory blocks occupy overlapping pages.
ResourceA must be in less memory offset than ResourceB.