From 0bbde1750e790f2515f0e2eda7af602a5ce0927e Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 11 May 2022 12:37:14 +0200 Subject: [PATCH] Removed unused functions VmaQuickSort, VmaQuickSortPartition Closes #262. Thanks @laurelkeys ! --- include/vk_mem_alloc.h | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 904fd62..9a639c1 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -3377,44 +3377,6 @@ static inline bool VmaStrIsEmpty(const char* pStr) return pStr == VMA_NULL || *pStr == '\0'; } -#ifndef VMA_SORT -template -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 -void VmaQuickSort(Iterator beg, Iterator end, Compare cmp) -{ - if (beg < end) - { - Iterator it = VmaQuickSortPartition(beg, end, cmp); - VmaQuickSort(beg, it, cmp); - VmaQuickSort(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.